| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public UserPrincipal | |
| public String | name()
Overrides org. Implements java. Returns the name of the attribute view. |
| public PosixFileAttributes | readAttributes()
Implements java. Reads the basic file attributes as a bulk operation. |
| public void | setGroup(GroupPrincipal
the new file group-owner group)Implements java. Updates the file group-owner. |
| public void | setOwner(UserPrincipal
the new file owner owner)Implements java. Updates the file owner. |
| public void | setPermissions(Set<PosixFilePermission>
the new set of permissions perms)Implements java. Updates the file permissions. |
| public void | setTimes(FileTime
the new last modified time, or lastModifiedTime, FileTime null to not change the
valuethe last access time, or lastAccessTime, FileTime null to not change the valuethe file's create time, or createTime)null to not change the valueImplements java. Updates any or all of the file's last modified time, last access time, and create time attributes. |
| SftpPosixFileAttributeView | back to summary |
|---|---|
| public SftpPosixFileAttributeView(SftpFileSystemProvider provider, Path path, LinkOption... options) | |
| getOwner | back to summary |
|---|---|
| public UserPrincipal getOwner() throws IOException Implements java. Doc from java. Read the file owner. It is implementation specific if the file owner can be a
| |
| name | back to summary |
|---|---|
| public String name() Overrides org. Implements java. Doc from java. Returns the name of the attribute view. Attribute views of this type
have the name
| |
| readAttributes | back to summary |
|---|---|
| public PosixFileAttributes readAttributes() throws IOException Implements java. Doc from java. Reads the basic file attributes as a bulk operation. It is implementation specific if all file attributes are read as an atomic operation with respect to other file system operations.
| |
| setGroup | back to summary |
|---|---|
| public void setGroup(GroupPrincipal group) throws IOException Implements java. Doc from java. Updates the file group-owner.
| |
| setOwner | back to summary |
|---|---|
| public void setOwner(UserPrincipal owner) throws IOException Implements java. Doc from java. Updates the file owner. It is implementation specific if the file owner can be a
| |
| setPermissions | back to summary |
|---|---|
| public void setPermissions(Set<PosixFilePermission> perms) throws IOException Implements java. Doc from java. Updates the file permissions.
| |
| setTimes | back to summary |
|---|---|
| public void setTimes(FileTime lastModifiedTime, FileTime lastAccessTime, FileTime createTime) throws IOException Implements java. Doc from java. Updates any or all of the file's last modified time, last access time, and create time attributes. This method updates the file's timestamp attributes. The values are
converted to the epoch and precision supported by the file system.
Converting from finer to coarser granularities results in precision loss.
The behavior of this method when attempting to set a timestamp that is
not supported or to a value that is outside the range supported by the
underlying file store is not defined. It may or not fail by throwing an
If any of the Usage Example: Suppose we want to change a file's last access time. Path path = ... FileTime time = ... Files.getFileAttributeView(path, BasicFileAttributeView.class).setTimes(null, time, null);
| |