java.lang.Object | ||
↳ | java.io.File | |
↳ | sun.awt.shell.ShellFolder |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
parent |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Tests whether the application can read the file denoted by this
abstract pathname.
| |||||||||||
Returns true if folder allows creation of children.
| |||||||||||
Compares this ShellFolder with the specified ShellFolder for order.
| |||||||||||
Atomically creates a new, empty file named by this abstract pathname if
and only if a file with this name does not yet exist.
| |||||||||||
Deletes the file or directory denoted by this abstract pathname.
| |||||||||||
Requests that the file or directory denoted by this abstract
pathname be deleted when the virtual machine terminates.
| |||||||||||
Tests whether the file or directory denoted by this abstract pathname
exists.
| |||||||||||
Returns the absolute form of this abstract pathname.
| |||||||||||
Canonicalizes files that don't have symbolic links in their path.
| |||||||||||
Returns the path for this object's parent,
or
null if this object does not name a parent
folder. | |||||||||||
Returns a File object representing this object's parent,
or
null if this object does not name a parent
folder. | |||||||||||
Return a shell folder from a file object
| |||||||||||
Tests whether this abstract pathname is absolute.
| |||||||||||
Does
dir represent a "computer" such as a node on the network, or
"My Computer" on the desktop. | |||||||||||
Tests whether the file denoted by this abstract pathname is a
directory.
| |||||||||||
Tests whether the file denoted by this abstract pathname is a normal
file.
| |||||||||||
Returns the time that the file denoted by this abstract pathname was
last modified.
| |||||||||||
Returns the length of the file denoted by this abstract pathname.
| |||||||||||
Returns an array of abstract pathnames denoting the files in the
directory denoted by this abstract pathname.
| |||||||||||
Creates the directory named by this abstract pathname.
| |||||||||||
Creates the directory named by this abstract pathname, including any
necessary but nonexistent parent directories.
| |||||||||||
Renames the file denoted by this abstract pathname.
| |||||||||||
Sets the last-modified time of the file or directory named by this
abstract pathname.
| |||||||||||
Marks the file or directory named by this abstract pathname so that
only read operations are allowed.
| |||||||||||
Returns the pathname string of this abstract pathname.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method must be implemented to make sure that no instances
of
ShellFolder are ever serialized. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Tests whether the application can read the file denoted by this abstract pathname.
true
if and only if the file specified by this
abstract pathname exists and can be read by the
application; false
otherwiseReturns true if folder allows creation of children. True for the "Desktop" folder, but false for the "My Computer" folder.
true
if and only if the file system actually
contains a file denoted by this abstract pathname and
the application is allowed to write to the file;
false
otherwise.Compares this ShellFolder with the specified ShellFolder for order.
file2 | The abstract pathname to be compared to this abstract pathname |
---|
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
FileLock
facility should be used instead.
true
if the named file does not exist and was
successfully created; false
if the named file
already existsIOException |
---|
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.
true
if and only if the file or directory is
successfully deleted; false
otherwiseRequests that the file or directory denoted by this abstract pathname be deleted when the virtual machine terminates. Files (or directories) are deleted in the reverse order that they are registered. Invoking this method to delete a file or directory that is already registered for deletion has no effect. Deletion will be attempted only for normal termination of the virtual machine, as defined by the Java Language Specification.
Once deletion has been requested, it is not possible to cancel the request. This method should therefore be used with care.
Note: this method should not be used for file-locking, as
the resulting protocol cannot be made to work reliably. The
FileLock
facility should be used instead.
Tests whether the file or directory denoted by this abstract pathname exists.
true
if and only if the file or directory denoted
by this abstract pathname exists; false
otherwisekey | a String |
---|
key
.Returns the absolute form of this abstract pathname. Equivalent to
new File(this.
.getAbsolutePath()
)
getLargeIcon | whether to return large icon (ignored in base implementation) |
---|
FileNotFoundException |
---|
Canonicalizes files that don't have symbolic links in their path. Normalizes files that do, preserving symbolic links from being resolved.
IOException |
---|
Returns the path for this object's parent,
or null
if this object does not name a parent
folder.
null
if this object does not name a parent
folderReturns a File object representing this object's parent,
or null
if this object does not name a parent
folder.
null
if this object does not name a parent
folderReturn a shell folder from a file object
FileNotFoundException | if file does not exist |
---|
Tests whether this abstract pathname is absolute. The definition of
absolute pathname is system dependent. On UNIX systems, a pathname is
absolute if its prefix is "/"
. On Microsoft Windows systems, a
pathname is absolute if its prefix is a drive specifier followed by
"\\"
, or if its prefix is "\\\\"
.
true
if this abstract pathname is absolute,
false
otherwise
Does dir
represent a "computer" such as a node on the network, or
"My Computer" on the desktop.
Tests whether the file denoted by this abstract pathname is a directory.
true
if and only if the file denoted by this
abstract pathname exists and is a directory;
false
otherwiseTests 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.
true
if and only if the file denoted by this
abstract pathname exists and is a normal file;
false
otherwiseReturns the time that the file denoted by this abstract pathname was last modified.
long
value representing the time the file was
last modified, measured in milliseconds since the epoch
(00:00:00 GMT, January 1, 1970), or 0L
if the
file does not exist or if an I/O error occursReturns the length of the file denoted by this abstract pathname. The return value is unspecified if this pathname denotes a directory.
0L
if the file does not exist. Some
operating systems may return 0L
for pathnames
denoting system-dependent entities such as devices or pipes.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 null
. Otherwise an array of File
objects
is returned, one for each file or directory in the directory. Pathnames
denoting the directory itself and the directory's parent directory are
not included in the result. Each resulting abstract pathname is
constructed from this abstract pathname using the File(File, String)
constructor. Therefore if this
pathname is absolute then each resulting pathname is absolute; if this
pathname is relative then each resulting pathname will be relative to
the same directory.
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.
null
if this abstract pathname does not denote a
directory, or if an I/O error occurs.Creates the directory named by this abstract pathname.
true
if and only if the directory was
created; false
otherwiseCreates 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.
true
if and only if the directory was created,
along with all necessary parent directories; false
otherwiseRenames 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.
dest | The new abstract pathname for the named file |
---|
true
if and only if the renaming succeeded;
false
otherwiseSets 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
method will return the (possibly
truncated) lastModified()
time
argument that was passed to this method.
time | The new last-modified time, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970) |
---|
true
if and only if the operation succeeded;
false
otherwiseMarks the file or directory named by this abstract pathname so that only read operations are allowed. After invoking this method the file or directory is guaranteed not to change until it is either deleted or marked to allow write access. Whether or not a read-only file or directory may be deleted depends upon the underlying system.
true
if and only if the operation succeeded;
false
otherwiseReturns the pathname string of this abstract pathname. This is just the
string returned by the
method.getPath()
This method must be implemented to make sure that no instances
of ShellFolder
are ever serialized. If isFileSystem()
returns
true
, then the object should be representable with an instance of
java.io.File
instead. If not, then the object is most likely
depending on some internal (native) state and cannot be serialized.
ObjectStreamException |
---|