Interface PathAttributes
-
- All Known Implementing Classes:
PathAttributesImplementation
public interface PathAttributesFileAttributes represents a set of attributes of a path.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetCreationTime()Get the creation time for this file.java.lang.StringgetGroup()Get the group of this file (optional operation).longgetLastAccessTime()Get the last access time for this file.longgetLastModifiedTime()Get the last modified time for this file.java.lang.StringgetOwner()Get the owner of this file (optional operation).PathgetPath()Get the path these attributes belong to.java.util.Set<PosixFilePermission>getPermissions()Get the permissions of this file (optional operation).longgetSize()Get the size of this file in bytes.booleanisDirectory()Does the path refer to a directory ?booleanisExecutable()Does the path refer to an executable file ?booleanisHidden()Does the path refer to an hidden file ?booleanisOther()Is the path not a file, link or directory ?booleanisReadable()Does the path refer to an readable file ?booleanisRegular()Does the path refer to a regular file ?booleanisSymbolicLink()Does the path refer to a symbolic link ?booleanisWritable()Does the path refer to a writable file ?
-
-
-
Method Detail
-
getPath
Path getPath()
Get the path these attributes belong to.- Returns:
- the path these attributes belong to.
-
isDirectory
boolean isDirectory()
Does the path refer to a directory ?- Returns:
- if the path refers to a directory.
-
isRegular
boolean isRegular()
Does the path refer to a regular file ?- Returns:
- if the path refers to a regular file.
-
isSymbolicLink
boolean isSymbolicLink()
Does the path refer to a symbolic link ?- Returns:
- if the path refers to a symbolic link.
-
isOther
boolean isOther()
Is the path not a file, link or directory ?- Returns:
- if the path does not refer to a file, link or directory.
-
isExecutable
boolean isExecutable()
Does the path refer to an executable file ?- Returns:
- if the path refers an executable file ?
-
isReadable
boolean isReadable()
Does the path refer to an readable file ?- Returns:
- if the path refers an readable file ?
-
isWritable
boolean isWritable()
Does the path refer to a writable file ?- Returns:
- if the path refers a writable file ?
-
isHidden
boolean isHidden()
Does the path refer to an hidden file ?- Returns:
- if the path refers an hidden file ?
-
getCreationTime
long getCreationTime()
Get the creation time for this file. If creationTime is not supported by the adaptor,getLastModifiedTime()will be returned instead.- Returns:
- the creation time for this file.
-
getLastAccessTime
long getLastAccessTime()
Get the last access time for this file. If lastAccessTime is not supported by the adaptor, usegetLastModifiedTime()will be returned instead.- Returns:
- the last access time for this file.
-
getLastModifiedTime
long getLastModifiedTime()
Get the last modified time for this file. If lastModifiedTime is not supported by the adaptor,0will be returned instead.- Returns:
- the last modified time for this file.
-
getSize
long getSize()
Get the size of this file in bytes. If the file is not a regular file,0will be returned.- Returns:
- the size of this file.
-
getOwner
java.lang.String getOwner() throws AttributeNotSupportedExceptionGet the owner of this file (optional operation).- Returns:
- the owner of this file.
- Throws:
AttributeNotSupportedException- If the attribute is not supported by the adaptor.
-
getGroup
java.lang.String getGroup() throws AttributeNotSupportedExceptionGet the group of this file (optional operation).- Returns:
- the group of this file.
- Throws:
AttributeNotSupportedException- If the attribute is not supported by the adaptor.
-
getPermissions
java.util.Set<PosixFilePermission> getPermissions() throws AttributeNotSupportedException
Get the permissions of this file (optional operation).- Returns:
- the permissions of this file.
- Throws:
AttributeNotSupportedException- If the attribute is not supported by the adaptor.
-
-