Contents
Interface FileIOSystem
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AssetFileSystem
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classImmutable array of Paths.static final classInternal util for holding the current Thread's FileIOSystem instance. -
Method Summary
Modifier and TypeMethodDescriptionbaseRoot()Get the root Path of the base FileSystem used by this FileIOSystem.default voidclose()Close the FileIOSystem releasing any held resources.default <T> Tload(AssetPath path, AssetLoader<T> loader) Load an asset from a given file Path.default AssetPathConvert an asset Path to the actual file Path found within the FileIOSystem.roots()Get all root Paths used by this FileIOSystem.
-
Method Details
-
baseRoot
Get the root Path of the base FileSystem used by this FileIOSystem.- Returns:
- The base root Path.
-
roots
Get all root Paths used by this FileIOSystem.- Returns:
- An array of root Paths.
-
resolve
-
load
@Nonnull default <T> T load(@Nonnull AssetPath path, @Nonnull AssetLoader<T> loader) throws IOException Load an asset from a given file Path.- Parameters:
path- The asset Path to load the asset from.loader- The AssetLoader used to load the asset.- Returns:
- The loaded asset.
- Throws:
IOException- if the file does not exist or cannot otherwise be loaded.
-
close
default void close()Close the FileIOSystem releasing any held resources. Implementation should finally call FileIO.closeFileIOSystem(this) to ensure proper cleanup.- Specified by:
closein interfaceAutoCloseable
-