|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IMount
Represents a read only part of a virtual filesystem that can be mounted onto a computer using IComputerAccess.mount(). Ready made implementations of this interface can be created using ComputerCraftAPI.createSaveDirMount() or ComputerCraftAPI.createResourceMount(), or you're free to implement it yourselves!
ComputerCraftAPI#createSaveDirMount(World, String)
,
ComputerCraftAPI.createResourceMount(Class, String, String)
,
IComputerAccess.mount(String, IMount)
,
IWritableMount
Method Summary | |
---|---|
boolean |
exists(java.lang.String path)
Returns whether a file with a given path exists or not. |
long |
getSize(java.lang.String path)
Returns the size of a file with a given path, in bytes |
boolean |
isDirectory(java.lang.String path)
Returns whether a file with a given path is a directory or not. |
void |
list(java.lang.String path,
java.util.List<java.lang.String> contents)
Returns the file names of all the files in a directory. |
java.io.InputStream |
openForRead(java.lang.String path)
Opens a file with a given path, and returns an inputstream representing it's contents. |
Method Detail |
---|
boolean exists(java.lang.String path) throws java.io.IOException
path
- A file path in normalised format, relative to the mount location. ie: "programs/myprogram"
java.io.IOException
boolean isDirectory(java.lang.String path) throws java.io.IOException
path
- A file path in normalised format, relative to the mount location. ie: "programs/myprograms"
java.io.IOException
void list(java.lang.String path, java.util.List<java.lang.String> contents) throws java.io.IOException
path
- A file path in normalised format, relative to the mount location. ie: "programs/myprograms"contents
- A list of strings. Add all the file names to this list
java.io.IOException
long getSize(java.lang.String path) throws java.io.IOException
path
- A file path in normalised format, relative to the mount location. ie: "programs/myprogram"
java.io.IOException
java.io.InputStream openForRead(java.lang.String path) throws java.io.IOException
path
- A file path in normalised format, relative to the mount location. ie: "programs/myprogram"
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |