Method Summary |
|
public boolean | canRead() Answers a boolean indicating whether or not the current context is
allowed to read this File. |
public boolean | canWrite() Answers a boolean indicating whether or not the current context is
allowed to write to this File. |
public int | compareTo(File another) Answers the relative sort ordering of paths for the receiver and given
argument. |
public boolean | createNewFile() Creates the file specified by this File. |
public static File | createTempFile(String prefix, String suffix) Creates an empty temporary file using the given prefix and suffix as part
of the file name. |
public static File | createTempFile(String prefix, String suffix, File directory) Creates an empty temporary file in the given directory using the given
prefix and suffix as part of the file name. |
public boolean | delete() Deletes the file specified by this File. |
public void | deleteOnExit() When the virtual machine terminates, any abstract files which have been
sent deleteOnExit() will be deleted. |
public boolean | equals(Object obj) Compares the argument obj to the receiver, and answers
true if they represent the same object using a
path specific comparison. |
public boolean | exists() Answers a boolean indicating whether or not this File can be found on the
underlying file system. |
public File | getAbsoluteFile() Answers a new File constructed using the absolute file path of this File. |
public String | getAbsolutePath() Answers the absolute file path of this File. |
public File | getCanonicalFile() Answers a new File created using the canonical file path of this File. |
public String | getCanonicalPath() Answers the absolute file path of this File with all references resolved.
An absolute file path is one which begins at the root of the
file system. |
public String | getName() Answers the filename (not directory) of this File. |
public String | getParent() Answers the pathname of the parent of this File. |
public File | getParentFile() Answers a new File made from the pathname of the parent of this File.
This is the path up to but not including the last name. |
public String | getPath() Answers the file path of this File. |
public int | hashCode() Answers an integer hash code for the receiver. |
public boolean | isAbsolute() Answers if this File is an absolute pathname. |
public boolean | isDirectory() Answers if this File represents a directory on the underlying
file system. |
public boolean | isFile() Answers if this File represents a file on the underlying file
system. |
public boolean | isHidden() Returns whether or not this file is a hidden file as defined by the
operating system. |
public long | lastModified() Answers the time this File was last modified. |
public long | length() Answers the length of this File in bytes. |
public java.lang.String[] | list() Answers an array of Strings representing the file names in the directory
represented by this File. |
public java.lang.String[] | list(FilenameFilter filter) Answers an array of Strings representing the file names in the directory
represented by this File that match a specific filter. |
public File[] | listFiles() Answers an array of Files representing the file names in the directory
represented by this File. |
public File[] | listFiles(FilenameFilter filter) Answers an array of Files representing the file names in the directory
represented by this File that match a specific filter. |
public File[] | listFiles(FileFilter filter) Answers an array of Files representing the file names in the directory
represented by this File that match a specific filter. |
public static File[] | listRoots() Lists the filesystem roots.
The Java platform may support zero or more filesystems, each with its own
platform-dependent root. |
public boolean | mkdir() Creates the directory named by the trailing filename of this File. |
public boolean | mkdirs() Create all the directories needed for this File. |
byte[] | properPath(boolean internal) Answer a String representing the proper path for the receiver. |
public boolean | renameTo(java.io.File dest) Renames this File to the name represented by the File dest .
This works for both normal files and directories.
Parameters: dest - the File containing the new name. |
public boolean | setLastModified(long time) Sets the time this File was last modified.
Parameters: time - The time to set the file as last modified. |
public boolean | setReadOnly() Marks this file or directory to be read-only as defined by the operating
system. |
public String | toString() Answers a string containing a concise, human-readable description of the
receiver. |
public URI | toURI() Answers a file URI for this File. |
public URL | toURL() Answers a file URL for this File. |