|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BasicFileAttributes
Basic attributes associated with a file in a file system.
Basic file attributes are attributes that are common to many file systems and consist of mandatory and optional file attributes as defined by this interface.
Usage Example:
FileRef file = ... BasicFileAttributes attrs = Attributes.readBasicFileAttributes(file);
BasicFileAttributeView
Method Summary | |
---|---|
long |
creationTime()
Returns the creation time if supported. |
Object |
fileKey()
Returns an object that uniquely identifies the given file, or null if a file key is not available. |
boolean |
isDirectory()
Tells whether the file is a directory. |
boolean |
isOther()
Tells whether the file is something other than a regular file, directory, or link. |
boolean |
isRegularFile()
Tells whether the file is a regular file with opaque content. |
boolean |
isSymbolicLink()
Tells whether the file is a symbolic-link. |
long |
lastAccessTime()
Returns the time of last access if supported. |
long |
lastModifiedTime()
Returns the time of last modification. |
int |
linkCount()
Returns the number of links to this file. |
TimeUnit |
resolution()
Returns the TimeUnit required to interpret the time of last
modification, time of last access, and creation time. |
long |
size()
Returns the size of the file (in bytes). |
Method Detail |
---|
long lastModifiedTime()
The resolution
method returns the TimeUnit
to interpret the return value of this method.
long
value representing the time the file was
last modified since the epoch (00:00:00 GMT, January 1, 1970),
or -1L
if the attribute is not supported.long lastAccessTime()
The resolution
method returns the TimeUnit
to interpret the return value of this method.
long
value representing the time of last access
since the epoch (00:00:00 GMT, January 1, 1970), or -1L
if the attribute is not supported.long creationTime()
The resolution
method returns the TimeUnit
to interpret the return value of this method.
long
value representing the time the file was
created since the epoch (00:00:00 GMT, January 1, 1970), or
-1L
if the attribute is not supported.TimeUnit resolution()
TimeUnit
required to interpret the time of last
modification, time of last access, and creation time.
TimeUnit
required to interpret the file time stampsboolean isRegularFile()
boolean isDirectory()
boolean isSymbolicLink()
boolean isOther()
long size()
regular
files is implementation specific and
therefore unspecified.
int linkCount()
On file systems where the same file may be in several directories then
the link count is the number of directory entries for the file. The return
value is 1
on file systems that only allow a file to have a
single name in a single directory.
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |