read() and/or write(boolean). Methods
that would manipulate the file instead throw UnsupportedOperationException.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public FileHandle | child(String name)
Overrides com. Returns a handle to the child with the specified name. |
| public void | copyTo(FileHandle dest)
Overrides com. Copies this file or directory to the specified file or directory. |
| public boolean | delete()
Overrides com. Deletes this file or empty directory and returns success. |
| public boolean | deleteDirectory()
Overrides com. Deletes this file or directory and all children, recursively. |
| public void | emptyDirectory()
Overrides com. Deletes all children of this directory, recursively. |
| public void | emptyDirectory(boolean preserveTree)
Overrides com. Deletes all children of this directory, recursively. |
| public boolean | |
| public boolean | isDirectory()
Overrides com. Returns true if this file is a directory. |
| public long | length()
Overrides com. Returns the length in bytes of this file, or 0 if this file is a directory, does not exist, or the size cannot otherwise be determined. |
| public FileHandle[] | list()
Overrides com. Returns the paths to the children of this directory. |
| public void | |
| public void | moveTo(FileHandle dest)
Overrides com. Moves this file to the specified file, overwriting the file if it already exists. |
| public FileHandle | |
| public InputStream | read()
Overrides com. Returns a stream for reading this file as bytes. |
| public FileHandle | sibling(String name)
Overrides com. Returns a handle to the sibling with the specified name. |
| public OutputStream | write(boolean overwrite)
Overrides com. Returns a stream for writing to this file. |
| FileHandleStream | back to summary |
|---|---|
| public FileHandleStream(String path) Create an | |
| child | back to summary |
|---|---|
| public FileHandle child(String name) Overrides com. Doc from com. Returns a handle to the child with the specified name. | |
| copyTo | back to summary |
|---|---|
| public void copyTo(FileHandle dest) Overrides com. Doc from com. Copies this file or directory to the specified file or directory. If this handle is a file, then 1) if the destination is a
file, it is overwritten, or 2) if the destination is a directory, this file is copied into it, or 3) if the destination
doesn't exist, | |
| delete | back to summary |
|---|---|
| public boolean delete() Overrides com. Doc from com. Deletes this file or empty directory and returns success. Will not delete a directory that has children. | |
| deleteDirectory | back to summary |
|---|---|
| public boolean deleteDirectory() Overrides com. Doc from com. Deletes this file or directory and all children, recursively. | |
| emptyDirectory | back to summary |
|---|---|
| public void emptyDirectory() Overrides com. Doc from com. Deletes all children of this directory, recursively. | |
| emptyDirectory | back to summary |
|---|---|
| public void emptyDirectory(boolean preserveTree) Overrides com. Doc from com. Deletes all children of this directory, recursively. Optionally preserving the folder structure. | |
| exists | back to summary |
|---|---|
| public boolean exists() Overrides com. Doc from com. Returns true if the file exists. On Android, a | |
| isDirectory | back to summary |
|---|---|
| public boolean isDirectory() Overrides com. Doc from com. Returns true if this file is a directory. Always returns false for classpath files. On Android, an
| |
| length | back to summary |
|---|---|
| public long length() Overrides com. Doc from com. Returns the length in bytes of this file, or 0 if this file is a directory, does not exist, or the size cannot otherwise be determined. | |
| list | back to summary |
|---|---|
| public FileHandle[] list() Overrides com. Doc from com. Returns the paths to the children of this directory. Returns an empty list if this file handle represents a file and not a
directory. On the desktop, an | |
| mkdirs | back to summary |
|---|---|
| public void mkdirs() Overrides com. | |
| moveTo | back to summary |
|---|---|
| public void moveTo(FileHandle dest) Overrides com. Doc from com. Moves this file to the specified file, overwriting the file if it already exists. | |
| parent | back to summary |
|---|---|
| public FileHandle parent() Overrides com. | |
| read | back to summary |
|---|---|
| public InputStream read() Overrides com. Doc from com. Returns a stream for reading this file as bytes. | |
| sibling | back to summary |
|---|---|
| public FileHandle sibling(String name) Overrides com. Doc from com. Returns a handle to the sibling with the specified name. | |
| write | back to summary |
|---|---|
| public OutputStream write(boolean overwrite) Overrides com. Doc from com. Returns a stream for writing to this file. Parent directories will be created if necessary. | |