|
boolean |
canExecute() Tests whether the application can execute the file represented by this abstract path name. |
boolean |
canRead() Tests whether the application can read the file represented by this abstract pathname. |
boolean |
canWrite() Tests whether the application can modify the file represented by this abstract pathname. |
int |
compareTo(File pathname) Compares two abstract path names in alphabetical order. |
boolean |
createNewFile() When and only if there is no file with the name specified by this abstract pathname, a new empty file is not created. |
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 string to generate its name. |
boolean |
delete() Deletes the file or directory represented by this abstract path name. |
void |
deleteOnExit() When the virtual machine terminates, the request deletes the file or directory represented by this abstract path name. |
boolean |
equals(Object obj) Tests whether this abstract path name is equal to a given object. |
boolean |
exists() Tests whether the file or directory represented by this abstract path name exists. |
File |
getAbsoluteFile() Returns the absolute pathname form for this abstract path name. |
String |
getAbsolutePath() Returns the absolute path name string for this abstract pathname. |
File |
getCanonicalFile() Returns the canonical form of this abstract path name. |
String |
getCanonicalPath() Returns the canonical pathname string for this abstract path name. |
long |
getFreeSpace() Returns the number of unallocated bytes in the partition specified by this abstract path name. |
String |
getName() Returns the name of the file or directory represented by this abstract path name. |
String |
getParent() Returns the pathname string for this abstract pathname parent directory, or returns if this pathname does not specify a parent directory null . |
File |
getParentFile() Returns the abstract pathname of the parent directory for this abstract pathname, or returns if the path name does not specify a parent directory null . |
String |
getPath() Converts this abstract path name to a pathname string. |
long |
getTotalSpace() Returns the partition size specified by this abstract path name. |
long |
getUsableSpace() Returns the number of bytes available to this virtual machine on the partition specified by this abstract path name. |
int |
hashCode() Computes the hash code for this abstract path name. |
boolean |
isAbsolute() Tests whether this abstract path name is an absolute pathname. |
boolean |
isDirectory() Tests whether the file represented by this abstract path name is a directory. |
boolean |
isFile() Tests whether the file represented by this abstract path name is a standard file. |
boolean |
isHidden() Tests whether the file specified by this abstract path name is a hidden file. |
long |
lastModified() Returns the time of the last modification of the file represented by this abstract path name. |
long |
length() Returns the length of the file represented by this abstract path name. |
String[] |
list() Returns an array of strings that specify the files and directories in the directory represented by this abstract pathname. |
String[] |
list(FilenameFilter filter) Returns an array of strings that specify the files and directories in the directory that this abstract path name represents to satisfy the specified filter. |
File[] |
listFiles() Returns an abstract path to the an array group that represents the files in the directory represented by this abstract path name. |
File[] |
listFiles(FileFilter filter) Returns an abstract path to the an array group, which represents the files and directories in the directory that this abstract path name represents for the specified filter. |
File[] |
listFiles(FilenameFilter filter) Returns an abstract path to the an array group, which represents the files and directories in the directory that this abstract path name represents for the specified filter. |
static File[] |
listRoots() Lists the available file system roots. |
boolean |
mkdir() Creates the directory specified by this abstract path name. |
boolean |
mkdirs() Creates the directory specified by this abstract pathname, including all required but nonexistent parent directories. |
boolean |
renameTo(File dest) Renames the file represented by this abstract path name. |
boolean |
setExecutable(boolean executable) A convenient way to set this abstract path name owner to execute permissions. |
boolean |
setExecutable(boolean executable, boolean ownerOnly) Sets the execution permissions for the owner or all users of this abstract pathname. |
boolean |
setLastModified(long time) Sets the last modification time of the file or directory specified by this abstract path name. |
boolean |
setReadable(boolean readable) A convenient way to set the Read permission for this abstract pathname owner. |
boolean |
setReadable(boolean readable, boolean ownerOnly) Sets the Read permission for the owner or all users of this abstract path name. |
boolean |
setReadOnly() Marks the file or directory specified by this abstract pathname so that it can be read only. |
boolean |
setWritable(boolean writable) A convenient way to set this abstract pathname owner write permission. |
boolean |
setWritable(boolean writable, boolean ownerOnly) Sets the write permission for the owner or all users of this abstract path name. |
String |
toString() Returns the path name string for this abstract pathname. |
URI |
toURI() Constructs a file: URI that represents the name of this abstract pathname. |
URL |
toURL() is obsolete. This method does not automatically escape illegal characters in the URL. It is recommended that the new code convert the abstract pathname to a URL by first toURI converting it to a URI by method, and then URI.toURL reloading the URI as a URL by means of the method. |