File Members

File Members

Class Overview | This Package | All Packages

Fields
Name Description
pathSeparator The system-dependent path separator string.
pathSeparatorChar The system-dependent path separator character.
separator The system-dependent path separator character.
separatorChar The system-dependent path separator string.

Constructors
Name Description
File(File, String) Creates a File instance that represents the file with the specified name in the specified directory.
File(String) Creates a File instance that represents the file whose pathname is the given path argument.
File(String, String) Creates a File instance whose pathname is the pathname of the specified directory, followed by the separator character, followed by the name argument.

Methods
Name Description
canRead() Tests if the application can read from the specified file.
canWrite() Tests if the application can write to this file.
delete() Deletes the file specified by this object.
equals(Object) Compares this object against the specified object.
exists() Tests if this File exists.
getAbsolutePath() Returns the absolute pathname of the file represented by this object.
getCanonicalPath() Returns the canonical form of this File object's pathname.
getName() Returns the name of the file represented by this object.
getParent() Returns the parent part of the pathname of this File object, or null if the name has no parent part.
getPath() Returns the pathname of the file represented by this object.
hashCode() Computes a hashcode for the file.
isAbsolute() Tests if the file represented by this File object is an absolute pathname.
isDirectory() Tests if the file represented by this File object is a directory.
isFile() Tests if the file represented by this File object is a "normal" file.
lastModified() Returns the time that the file represented by this File object was last modified.
length() Returns the length of the file represented by this File object.
list() Returns a list of the files in the directory specified by this File object.
list(FilenameFilter) Returns a list of the files in the directory specified by this File that satisfy the specified filter.
mkdir() Creates a directory whose pathname is specified by this File object.
mkdirs() Creates a directory whose pathname is specified by this File object, including any necessary parent directories.
renameTo(File) Renames the file specified by this File object to have the pathname given by the File argument.
toString() Returns a string representation of this object.