public interface FileSystemAPI
Modifier and Type | Method and Description |
---|---|
ManagedEnvironment |
asManagedEnvironment(FileSystem fileSystem)
Deprecated.
Don't use this directly, use the wrapper in
FileSystem . |
ManagedEnvironment |
asManagedEnvironment(FileSystem fileSystem,
Label label)
Deprecated.
Don't use this directly, use the wrapper in
FileSystem . |
ManagedEnvironment |
asManagedEnvironment(FileSystem fileSystem,
Label label,
EnvironmentHost host,
java.lang.String accessSound)
Deprecated.
Don't use this directly, use the wrapper in
FileSystem . |
ManagedEnvironment |
asManagedEnvironment(FileSystem fileSystem,
Label label,
EnvironmentHost host,
java.lang.String accessSound,
int speed)
Creates a network node that makes the specified file system available via
the common file system driver.
|
ManagedEnvironment |
asManagedEnvironment(FileSystem fileSystem,
java.lang.String label)
Deprecated.
Don't use this directly, use the wrapper in
FileSystem . |
ManagedEnvironment |
asManagedEnvironment(FileSystem fileSystem,
java.lang.String label,
EnvironmentHost host,
java.lang.String accessSound)
Deprecated.
Don't use this directly, use the wrapper in
FileSystem . |
ManagedEnvironment |
asManagedEnvironment(FileSystem fileSystem,
java.lang.String label,
EnvironmentHost host,
java.lang.String accessSound,
int speed)
Creates a network node that makes the specified file system available via
the common file system driver.
|
FileSystem |
asReadOnly(FileSystem fileSystem)
Wrap a file system retrieved via one of the from??? methods to
make it read-only.
|
FileSystem |
fromClass(java.lang.Class<?> clazz,
java.lang.String domain,
java.lang.String root)
Creates a new file system based on the location of a class.
|
FileSystem |
fromComputerCraft(java.lang.Object mount)
Creates a new file system based on a read-only ComputerCraft mount.
|
FileSystem |
fromMemory(long capacity)
Creates a new writable file system that resides in memory.
|
FileSystem |
fromSaveDirectory(java.lang.String root,
long capacity,
boolean buffered)
Creates a new writable file system in the save folder.
|
FileSystem fromClass(java.lang.Class<?> clazz, java.lang.String domain, java.lang.String root)
"/assets/" + domain + "/" + rootIf the class is located in a JAR file, this will create a read-only file system based on that JAR file. If the class file is located in the native file system, this will create a read-only file system first trying from the actual location of the class file, and failing that by searching the class path (i.e. it'll look for a path constructed as described above). If the specified path cannot be located, the creation fails and this returns null.
clazz
- the class whose containing JAR to wrap.domain
- the domain, usually your mod's ID.root
- an optional subdirectory.FileSystem fromSaveDirectory(java.lang.String root, long capacity, boolean buffered)
"saves/" + WORLD_NAME + "/opencomputers/" + rootThe first part may differ, in particular for servers. Usually the name will be the address of the node used to represent the file system. Note that by default file systems are "buffered", meaning that any changes made to them are only saved to disk when the world is saved. This ensured that the file system contents do not go "out of sync" when the game crashes, but introduces additional memory overhead, since all files in the file system have to be kept in memory.
root
- the name of the file system.capacity
- the amount of space in bytes to allow being used.buffered
- whether data should only be written to disk when saving.FileSystem fromMemory(long capacity)
capacity
- the capacity of the file system.FileSystem fromComputerCraft(java.lang.Object mount)
mount
- the mount to wrap with a file system.FileSystem asReadOnly(FileSystem fileSystem)
fileSystem
- the file system to wrap.ManagedEnvironment asManagedEnvironment(FileSystem fileSystem, Label label, EnvironmentHost host, java.lang.String accessSound, int speed)
fileSystem
- the file system to wrap.label
- the label of the file system.host
- the tile entity containing the file system.accessSound
- the name of the sound effect to play when the file
system is accessed. This has to be the fully
qualified resource name, e.g.
opencomputers:floppy_access.speed
- the speed multiplier for this file system.ManagedEnvironment asManagedEnvironment(FileSystem fileSystem, java.lang.String label, EnvironmentHost host, java.lang.String accessSound, int speed)
fileSystem
- the file system to wrap.label
- the read-only label of the file system.host
- the tile entity containing the file system.accessSound
- the name of the sound effect to play when the file
system is accessed. This has to be the fully
qualified resource name, e.g.
opencomputers:floppy_access.speed
- the speed multiplier for this file system.@Deprecated ManagedEnvironment asManagedEnvironment(FileSystem fileSystem, Label label, EnvironmentHost host, java.lang.String accessSound)
FileSystem
.@Deprecated ManagedEnvironment asManagedEnvironment(FileSystem fileSystem, java.lang.String label, EnvironmentHost host, java.lang.String accessSound)
FileSystem
.@Deprecated ManagedEnvironment asManagedEnvironment(FileSystem fileSystem, Label label)
FileSystem
.@Deprecated ManagedEnvironment asManagedEnvironment(FileSystem fileSystem, java.lang.String label)
FileSystem
.@Deprecated ManagedEnvironment asManagedEnvironment(FileSystem fileSystem)
FileSystem
.