| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | canRead()
Overrides java. |
| public boolean | canWrite()
Overrides java. |
| public boolean | createNewFile()
Overrides java. |
| public boolean | delete()
Overrides java. |
| public boolean | exists()
Overrides java. |
| public File | getAbsoluteFile()
Overrides java. |
| public File | getCanonicalFile()
Overrides java. |
| public String | getCanonicalPath()
Overrides java. |
| public File | getParentFile()
Overrides java. null if this pathname does not name a parent
directory.
|
| public boolean | isDirectory()
Overrides java. |
| public boolean | isFile()
Overrides java. |
| public boolean | isHidden()
Overrides java. |
| public long | lastModified()
Overrides java. |
| public long | length()
Overrides java. |
| public String[] | list()
Overrides java. |
| public String[] | list(FilenameFilter
A filename filter filter)Overrides java. |
| public File[] | listFiles()
Overrides java. |
| public File[] | listFiles(FileFilter
A file filter filter)Overrides java. |
| public boolean | |
| public boolean | mkdirs()
Overrides java. |
| public boolean | renameTo(File
The new abstract pathname for the named file dest)Overrides java. |
| public boolean | setLastModified(long
The new last-modified time, measured in milliseconds since
the epoch (00:00:00 GMT, January 1, 1970) time)Overrides java. |
| public boolean | setReadOnly()
Overrides java. |
| JavaSecuredFile | back to summary |
|---|---|
| public JavaSecuredFile(String pathname) | |
| JavaSecuredFile | back to summary |
|---|---|
| public JavaSecuredFile(String parent, String child) | |
| JavaSecuredFile | back to summary |
|---|---|
| public JavaSecuredFile(File parent, String child) | |
| JavaSecuredFile | back to summary |
|---|---|
| public JavaSecuredFile(URI uri) | |
| canRead | back to summary |
|---|---|
| public boolean canRead() Overrides java. Doc from java. Tests whether the application can read the file denoted by this
abstract pathname. On some platforms it may be possible to start the
Java virtual machine with special privileges that allow it to read
files that are marked as unreadable. Consequently, this method may return
| |
| canWrite | back to summary |
|---|---|
| public boolean canWrite() Overrides java. Doc from java. Tests whether the application can modify the file denoted by this
abstract pathname. On some platforms it may be possible to start the
Java virtual machine with special privileges that allow it to modify
files that are marked read-only. Consequently, this method may return
| |
| createNewFile | back to summary |
|---|---|
| public boolean createNewFile() throws IOException Overrides java. Doc from java. Atomically creates a new, empty file named by this abstract pathname if and only if a file with this name does not yet exist. The check for the existence of the file and the creation of the file if it does not exist are a single operation that is atomic with respect to all other filesystem activities that might affect the file. Note this method should not be used for file-locking, as
the resulting protocol cannot be made to work reliably. The
| |
| delete | back to summary |
|---|---|
| public boolean delete() Overrides java. Doc from java. Deletes the file or directory denoted by this abstract pathname. If this pathname denotes a directory, then the directory must be empty in order to be deleted. Note that the
| |
| exists | back to summary |
|---|---|
| public boolean exists() Overrides java. Doc from java. Tests whether the file or directory denoted by this abstract pathname exists.
| |
| getAbsoluteFile | back to summary |
|---|---|
| public File getAbsoluteFile() Overrides java. Doc from java. Returns the absolute form of this abstract pathname. Equivalent to
| |
| getCanonicalFile | back to summary |
|---|---|
| public File getCanonicalFile() throws IOException Overrides java. Doc from java. Returns the canonical form of this abstract pathname. Equivalent to
| |
| getCanonicalPath | back to summary |
|---|---|
| public String getCanonicalPath() throws IOException Overrides java. Doc from java. Returns the canonical pathname string of this abstract pathname. A canonical pathname is both absolute and unique. The precise
definition of canonical form is system-dependent. This method first
converts this pathname to absolute form if necessary, as if by invoking the
Every pathname that denotes an existing file or directory has a unique canonical form. Every pathname that denotes a nonexistent file or directory also has a unique canonical form. The canonical form of the pathname of a nonexistent file or directory may be different from the canonical form of the same pathname after the file or directory is created. Similarly, the canonical form of the pathname of an existing file or directory may be different from the canonical form of the same pathname after the file or directory is deleted.
| |
| getParentFile | back to summary |
|---|---|
| public File getParentFile() Overrides java. Doc from java. Returns the abstract pathname of this abstract pathname's parent,
or The parent of an abstract pathname consists of the pathname's prefix, if any, and each name in the pathname's name sequence except for the last. If the name sequence is empty then the pathname does not name a parent directory. | |
| isDirectory | back to summary |
|---|---|
| public boolean isDirectory() Overrides java. Doc from java. Tests whether the file denoted by this abstract pathname is a directory. Where it is required to distinguish an I/O exception from the case
that the file is not a directory, or where several attributes of the
same file are required at the same time, then the
| |
| isFile | back to summary |
|---|---|
| public boolean isFile() Overrides java. Doc from java. Tests whether the file denoted by this abstract pathname is a normal file. A file is normal if it is not a directory and, in addition, satisfies other system-dependent criteria. Any non-directory file created by a Java application is guaranteed to be a normal file. Where it is required to distinguish an I/O exception from the case
that the file is not a normal file, or where several attributes of the
same file are required at the same time, then the
| |
| isHidden | back to summary |
|---|---|
| public boolean isHidden() Overrides java. Doc from java. Tests whether the file named by this abstract pathname is a hidden
file. The exact definition of hidden is system-dependent. On
UNIX systems, a file is considered to be hidden if its name begins with
a period character (
| |
| lastModified | back to summary |
|---|---|
| public long lastModified() Overrides java. Doc from java. Returns the time that the file denoted by this abstract pathname was last modified.
| |
| length | back to summary |
|---|---|
| public long length() Overrides java. Doc from java. Returns the length of the file denoted by this abstract pathname. The return value is unspecified if this pathname denotes a directory. Where it is required to distinguish an I/O exception from the case
that
| |
| list | back to summary |
|---|---|
| public String[] list() Overrides java. Doc from java. Returns an array of strings naming the files and directories in the directory denoted by this abstract pathname. If this abstract pathname does not denote a directory, then this
method returns There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order. Note that the | |
| list | back to summary |
|---|---|
| public String[] list(FilenameFilter filter) Overrides java. Doc from java. Returns an array of strings naming the files and directories in the
directory denoted by this abstract pathname that satisfy the specified
filter. The behavior of this method is the same as that of the
| |
| listFiles | back to summary |
|---|---|
| public File[] listFiles() Overrides java. Doc from java. Returns an array of abstract pathnames denoting the files in the directory denoted by this abstract pathname. If this abstract pathname does not denote a directory, then this
method returns There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order. Note that the | |
| listFiles | back to summary |
|---|---|
| public File[] listFiles(FileFilter filter) Overrides java. Doc from java. Returns an array of abstract pathnames denoting the files and
directories in the directory denoted by this abstract pathname that
satisfy the specified filter. The behavior of this method is the same
as that of the
| |
| mkdir | back to summary |
|---|---|
| public boolean mkdir() Overrides java. Doc from java. Creates the directory named by this abstract pathname.
| |
| mkdirs | back to summary |
|---|---|
| public boolean mkdirs() Overrides java. Doc from java. Creates the directory named by this abstract pathname, including any necessary but nonexistent parent directories. Note that if this operation fails it may have succeeded in creating some of the necessary parent directories.
| |
| renameTo | back to summary |
|---|---|
| public boolean renameTo(File dest) Overrides java. Doc from java. Renames the file denoted by this abstract pathname. Many aspects of the behavior of this method are inherently
platform-dependent: The rename operation might not be able to move a
file from one filesystem to another, it might not be atomic, and it
might not succeed if a file with the destination abstract pathname
already exists. The return value should always be checked to make sure
that the rename operation was successful. As instances of Note that the | |
| setLastModified | back to summary |
|---|---|
| public boolean setLastModified(long time) Overrides java. Doc from java. Sets the last-modified time of the file or directory named by this abstract pathname. All platforms support file-modification times to the nearest second,
but some provide more precision. The argument will be truncated to fit
the supported precision. If the operation succeeds and no intervening
operations on the file take place, then the next invocation of the
| |
| setReadOnly | back to summary |
|---|---|
| public boolean setReadOnly() Overrides java. Doc from java. Marks the file or directory named by this abstract pathname so that only read operations are allowed. After invoking this method the file or directory will not change until it is either deleted or marked to allow write access. On some platforms it may be possible to start the Java virtual machine with special privileges that allow it to modify files that are marked read-only. Whether or not a read-only file or directory may be deleted depends upon the underlying system.
| |