Method |
Description |
int compareTo(File pathname) |
compares two abstract pathnames lexicographically. |
static File createTempFile(String prefix, String suffix) |
Creates an empty file in the default temporary-file directory, using the given prefix and suffix to generate its name. |
static File createTempFile(String prefix, String suffix, File directory) |
Creates a new empty file in the specified directory, using the given prefix and suffix strings to generate its name. |
void deleteOnExit() |
Requests that the file or directory denoted by this abstract pathname be deleted when the virtual machine terminates. |
boolean equals(Object obj) |
Tests this abstract pathname for equality with the given object. |
File getAbsoluteFile() |
Returns the absolute form of this abstract pathname. |
String getAbsolutePath() |
Returns the absolute pathname string of this abstract pathname. |
File getCanonicalFile() |
Returns the canonical form of this abstract pathname. |
String getCanonicalPath() |
Returns the canonical pathname string of this abstract pathname. |
long getFreeSpace() |
Returns the number of unallocated bytes in the partition named by this abstract path name. |
String getParent() |
Returns the pathname string of this abstract pathname's parent, or null if this pathname does not name a parent directory. |
File getParentFile() |
Returns the abstract pathname of this abstract pathname's parent, or null if this pathname does not name a parent directory. |
long getTotalSpace() |
Returns the size of the partition named by this abstract pathname. |
long getUsableSpace() |
Returns the number of bytes available to this virtual machine on the partition named by this abstract pathname. |
int hashCode() |
Computes a hash code for this abstract pathname. |
boolean isAbsolute() |
Tests whether this abstract pathname is absolute. |
boolean isHidden() |
Tests whether the file named by this abstract pathname is a hidden file. |
long lastModified() |
Returns the time that the file denoted by this abstract pathname was last modified. |
long length() |
Returns the length of the file denoted by this abstract pathname. |
String[] list() |
Returns an array of strings naming the files and directories in the directory denoted by this abstract pathname. |
String[] list(FilenameFilter filter) |
Returns an array of strings naming the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter. |
File[] listFiles() |
Returns an array of abstract pathnames denoting the files in the directory denoted by this abstract pathname. |
File[] listFiles(FileFilter filter) |
Returns an array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter. |
File[] listFiles(FilenameFilter filter) |
Returns an array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter. |
static File[] listRoots() |
lists the available filesystem roots. |
boolean mkdir() |
Creates the directory named by this abstract pathname. |
boolean renameTo(File dest) |
Renames the file denoted by this abstract pathname. |
boolean setExecutable(boolean executable, boolean ownerOnly) |
Sets the owner's or everybody's execute permission for this abstract pathname. |
boolean setLastModified(long time) |
Sets the last-modified time of the file or directory named by this abstract pathname. |
boolean setReadable(boolean readable) |
This is a convenience method to set the owner's read permission for this abstract pathname. |
boolean setReadable(boolean readable, boolean ownerOnly) |
Sets the owner's or everybody's read permission for this abstract pathname. |
boolean setWritable(boolean writable, boolean ownerOnly) |
Sets the owner's or everybody's write permission for this abstract pathname. |
String toString() |
Returns the pathname string of this abstract pathname. |
URI toURI() |
Constructs a file: URI that represents this abstract pathname. |