public abstract class BasicFileAttributesBase extends Object implements BasicFileAttributes
BasicFileAttributes
This abstract class defines the following (overridable) defaults:
FileTime return Unix epoch by default
(ie, Jan 1st, 1970 at midnight, GMT); this is what those methods must
return if a particular path/time combination is not supported;isSymbolicLink() and isOther() both return false;
fileKey() returns null.| Modifier and Type | Field and Description |
|---|---|
protected static FileTime |
UNIX_EPOCH
Unix epoch as a
FileTime |
| Constructor and Description |
|---|
BasicFileAttributesBase() |
| Modifier and Type | Method and Description |
|---|---|
FileTime |
creationTime()
Returns the creation time.
|
Object |
fileKey()
Returns an object that uniquely identifies the given file, or
null if a file key is not available. |
boolean |
isOther()
Tells whether the file is something other than a regular file, directory,
or symbolic link.
|
boolean |
isSymbolicLink()
Tells whether the file is a symbolic link.
|
FileTime |
lastAccessTime()
Returns the time of last access.
|
FileTime |
lastModifiedTime()
Returns the time of last modification.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisDirectory, isRegularFile, sizepublic FileTime lastModifiedTime()
If the file system implementation does not support a time stamp
to indicate the time of last modification then this method returns an
implementation specific default value, typically a FileTime
representing the epoch (1970-01-01T00:00:00Z).
lastModifiedTime in interface BasicFileAttributesFileTime representing the time the file was last
modifiedpublic FileTime lastAccessTime()
If the file system implementation does not support a time stamp
to indicate the time of last access then this method returns
an implementation specific default value, typically the last-modified-time or a FileTime
representing the epoch (1970-01-01T00:00:00Z).
lastAccessTime in interface BasicFileAttributesFileTime representing the time of last accesspublic FileTime creationTime()
If the file system implementation does not support a time stamp
to indicate the time when the file was created then this method returns
an implementation specific default value, typically the last-modified-time or a FileTime
representing the epoch (1970-01-01T00:00:00Z).
creationTime in interface BasicFileAttributesFileTime representing the time the file was createdpublic boolean isSymbolicLink()
isSymbolicLink in interface BasicFileAttributespublic boolean isOther()
isOther in interface BasicFileAttributespublic Object fileKey()
null if a file key is not available. On some platforms or file systems
it is possible to use an identifier, or a combination of identifiers to
uniquely identify a file. Such identifiers are important for operations
such as file tree traversal in file systems that support symbolic links or file systems
that allow a file to be an entry in more than one directory. On UNIX file
systems, for example, the device ID and inode are
commonly used for such purposes.
The file key returned by this method can only be guaranteed to be unique if the file system and files remain static. Whether a file system re-uses identifiers after a file is deleted is implementation dependent and therefore unspecified.
File keys returned by this method can be compared for equality and
are
suitable for use in collections. If the file system and files remain
static,
and two files are the same with
non-null file keys, then their file keys are equal.