Interface PathAttributes
-
- All Known Implementing Classes:
PathAttributesImplementation
public interface PathAttributes
FileAttributes represents a set of attributes of a path.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getCreationTime()
Get the creation time for this file.java.lang.String
getGroup()
Get the group of this file (optional operation).long
getLastAccessTime()
Get the last access time for this file.long
getLastModifiedTime()
Get the last modified time for this file.java.lang.String
getOwner()
Get the owner of this file (optional operation).Path
getPath()
Get the path these attributes belong to.java.util.Set<PosixFilePermission>
getPermissions()
Get the permissions of this file (optional operation).long
getSize()
Get the size of this file in bytes.boolean
isDirectory()
Does the path refer to a directory ?boolean
isExecutable()
Does the path refer to an executable file ?boolean
isHidden()
Does the path refer to an hidden file ?boolean
isOther()
Is the path not a file, link or directory ?boolean
isReadable()
Does the path refer to an readable file ?boolean
isRegular()
Does the path refer to a regular file ?boolean
isSymbolicLink()
Does the path refer to a symbolic link ?boolean
isWritable()
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,0
will 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,0
will be returned.- Returns:
- the size of this file.
-
getOwner
java.lang.String getOwner() throws AttributeNotSupportedException
Get 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 AttributeNotSupportedException
Get 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.
-
-