| Modifier and Type | Class and Description |
|---|---|
| public static enum | FileDescriptor.
Indicates how to resolve a path to a file. |
| Modifier and Type | Field and Description |
|---|---|
| protected File | |
| protected FileDescriptor. |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | |
| public | |
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public FileDescriptor | |
| private static void | |
| private static void | |
| public void | |
| public boolean | |
| public boolean | |
| private static boolean | |
| public boolean | |
| public String | |
| public File | |
| public boolean | |
| public long | |
| public long | length()
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 FileDescriptor[] | |
| public FileDescriptor[] | |
| public boolean | |
| public void | moveTo(FileDescriptor dest)
Moves this file to the specified file, overwriting the file if it already exists. |
| public String | |
| public String | |
| public FileDescriptor | |
| public String | |
| public InputStream | |
| public byte[] | |
| public int | |
| public Reader | |
| public Reader | |
| public BufferedReader | |
| public BufferedReader | |
| public String | |
| public String | |
| public static FileDescriptor | |
| public static FileDescriptor | |
| public String | |
| public FileDescriptor. | |
| public OutputStream | write(boolean
If false, this file will be overwritten if it exists, otherwise it will be appended. append)Returns a stream for writing to this file. |
| public void | write(InputStream input, boolean
If false, this file will be overwritten if it exists, otherwise it will be appended. append)Reads the remaining bytes from the specified stream and writes them to this file. |
| public void | writeBytes(byte[] bytes, boolean
If false, this file will be overwritten if it exists, otherwise it will be appended. append)Writes the specified bytes to the file. |
| public Writer | writer(boolean
If false, this file will be overwritten if it exists, otherwise it will be appended. append)Returns a writer for writing to this file using the default charset. |
| public Writer | |
| public void | writeString(String string, boolean
If false, this file will be overwritten if it exists, otherwise it will be appended. append)Writes the specified string to the file using the default charset. |
| public void | writeString(String string, boolean
If false, this file will be overwritten if it exists, otherwise it will be appended. append, String May be null to use the default charset. charset)Writes the specified string to the file as UTF-8. |
| file | back to summary |
|---|---|
| protected File file | |
| type | back to summary |
|---|---|
| protected FileDescriptor. | |
| FileDescriptor | back to summary |
|---|---|
| protected FileDescriptor() | |
| FileDescriptor | back to summary |
|---|---|
| public FileDescriptor(String fileName) Creates a new absolute FileHandle for the file name. Use this for tools on the desktop that don't need any of the backends. Do not use this constructor in case you write something cross-platform. Use the Files interface instead.
| |
| FileDescriptor | back to summary |
|---|---|
| public FileDescriptor(File file) Creates a new absolute FileHandle for the
| |
| FileDescriptor | back to summary |
|---|---|
| protected FileDescriptor(String fileName, FileDescriptor. | |
| FileDescriptor | back to summary |
|---|---|
| protected FileDescriptor(File file, FileDescriptor. | |
| child | back to summary |
|---|---|
| public FileDescriptor child(String name) Returns a handle to the child with the specified name.
| |
| copyDirectory | back to summary |
|---|---|
| private static void copyDirectory(FileDescriptor sourceDir, FileDescriptor destDir) | |
| copyFile | back to summary |
|---|---|
| private static void copyFile(FileDescriptor source, FileDescriptor dest) | |
| copyTo | back to summary |
|---|---|
| public void copyTo(FileDescriptor dest) 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() Deletes this file or empty directory and returns success. Will not delete a directory that has children.
| |
| deleteDirectory | back to summary |
|---|---|
| public boolean deleteDirectory() Deletes this file or directory and all children, recursively.
| |
| deleteDirectory | back to summary |
|---|---|
| private static boolean deleteDirectory(File file) | |
| exists | back to summary |
|---|---|
| public boolean exists() Returns true if the file exists. On Android, a | |
| extension | back to summary |
|---|---|
| public String extension() | |
| file | back to summary |
|---|---|
| public File file() Returns a java.io.File that represents this file handle. Note the returned file will only be usable for
| |
| isDirectory | back to summary |
|---|---|
| public boolean isDirectory() Returns true if this file is a directory. Always returns false for classpath files. On Android, an FileType#Internal handle to an empty directory will return false. On the desktop, an FileType#Internal handle to a directory on the classpath will return false. | |
| lastModified | back to summary |
|---|---|
| public long lastModified() Returns the last modified time in milliseconds for this file. Zero is returned if the file doesn't exist. Zero is returned
for | |
| length | back to summary |
|---|---|
| public long length() 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 FileDescriptor[] list() 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 FileType#Internal handle to a directory on the classpath will return a zero length array.
| |
| list | back to summary |
|---|---|
| public FileDescriptor[] list(String suffix) Returns the paths to the children of this directory with the specified suffix. Returns an empty list if this file handle represents a file and not a directory. On the desktop, an FileType#Internal handle to a directory on the classpath will return a zero length array.
| |
| mkdirs | back to summary |
|---|---|
public boolean mkdirs()
| |
| moveTo | back to summary |
|---|---|
| public void moveTo(FileDescriptor dest) Moves this file to the specified file, overwriting the file if it already exists.
| |
| name | back to summary |
|---|---|
| public String name() | |
| nameWithoutExtension | back to summary |
|---|---|
| public String nameWithoutExtension() | |
| parent | back to summary |
|---|---|
| public FileDescriptor parent() | |
| path | back to summary |
|---|---|
| public String path() | |
| read | back to summary |
|---|---|
| public InputStream read() Returns a stream for reading this file as bytes.
| |
| readBytes | back to summary |
|---|---|
| public byte[] readBytes() Reads the entire file into a byte array.
| |
| readBytes | back to summary |
|---|---|
| public int readBytes(byte[] bytes, int offset, int size) Reads the entire file into the byte array. The byte array must be big enough to hold the file's data.
| |
| reader | back to summary |
|---|---|
| public Reader reader() Returns a reader for reading this file as characters.
| |
| reader | back to summary |
|---|---|
| public Reader reader(String charset) Returns a reader for reading this file as characters.
| |
| reader | back to summary |
|---|---|
| public BufferedReader reader(int bufferSize) Returns a buffered reader for reading this file as characters.
| |
| reader | back to summary |
|---|---|
| public BufferedReader reader(int bufferSize, String charset) Returns a buffered reader for reading this file as characters.
| |
| readString | back to summary |
|---|---|
| public String readString() Reads the entire file into a string using the platform's default charset.
| |
| readString | back to summary |
|---|---|
| public String readString(String charset) Reads the entire file into a string using the specified charset.
| |
| tempDirectory | back to summary |
|---|---|
| public static FileDescriptor tempDirectory(String prefix) | |
| tempFile | back to summary |
|---|---|
| public static FileDescriptor tempFile(String prefix) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |
| type | back to summary |
|---|---|
| public FileDescriptor. | |
| write | back to summary |
|---|---|
| public OutputStream write(boolean append) Returns a stream for writing to this file. Parent directories will be created if necessary.
| |
| write | back to summary |
|---|---|
| public void write(InputStream input, boolean append) Reads the remaining bytes from the specified stream and writes them to this file. The stream is closed. Parent directories will be created if necessary.
| |
| writeBytes | back to summary |
|---|---|
| public void writeBytes(byte[] bytes, boolean append) Writes the specified bytes to the file. Parent directories will be created if necessary.
| |
| writer | back to summary |
|---|---|
| public Writer writer(boolean append) Returns a writer for writing to this file using the default charset. Parent directories will be created if necessary.
| |
| writer | back to summary |
|---|---|
| public Writer writer(boolean append, String charset) Returns a writer for writing to this file. Parent directories will be created if necessary.
| |
| writeString | back to summary |
|---|---|
| public void writeString(String string, boolean append) Writes the specified string to the file using the default charset. Parent directories will be created if necessary.
| |
| writeString | back to summary |
|---|---|
| public void writeString(String string, boolean append, String charset) Writes the specified string to the file as UTF-8. Parent directories will be created if necessary.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final FileDescriptor. | Absolute
Path that is a fully qualified, absolute filesystem path. |
| public static final FileDescriptor. | Classpath
Path relative to the root of the classpath. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static FileDescriptor. | |
| public static FileDescriptor. |
| Absolute | back to summary |
|---|---|
| public static final FileDescriptor. Path that is a fully qualified, absolute filesystem path. To ensure portability across platforms use absolute files only when absolutely (heh) necessary. | |
| Classpath | back to summary |
|---|---|
| public static final FileDescriptor. Path relative to the root of the classpath. Classpath files are always readonly. Note that classpath files are not compatible with some functionality on Android, such as Audio#newSound(FileHandle) and Audio#newMusic(FileHandle). | |
| FileType | back to summary |
|---|---|
| private FileType() | |
| valueOf | back to summary |
|---|---|
| public static FileDescriptor. | |
| values | back to summary |
|---|---|
| public static FileDescriptor. | |