Top Fields Constructors Methods
org.apache.sshd.sftp.client.fs

public Class SftpAclFileAttributeView

extends AbstractSftpFileAttributeView
implements AclFileAttributeView
Class Inheritance
All Implemented Interfaces
java.nio.file.attribute.AclFileAttributeView, java.nio.file.attribute.FileOwnerAttributeView, java.nio.file.attribute.FileAttributeView, java.nio.file.attribute.AttributeView
Imports
java.io.IOException, java.nio.file.LinkOption, .Path, java.nio.file.attribute.AclEntry, .AclFileAttributeView, .PosixFileAttributes, .UserPrincipal, java.util.List, org.apache.sshd.common.util.io.IoUtils, org.apache.sshd.sftp.client.SftpClient, org.apache.sshd.sftp.client.impl.AbstractSftpFileAttributeView

Author
Apache MINA SSHD Project

Field Summary

Inherited from org.apache.sshd.sftp.client.impl.AbstractSftpFileAttributeView:
optionspathprovider

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public List<AclEntry>
getAcl()

Implements java.nio.file.attribute.AclFileAttributeView.getAcl.

Reads the access control list.

public UserPrincipal
public String
public void
setAcl(List<AclEntry>
the new access control list
acl
)

Implements java.nio.file.attribute.AclFileAttributeView.setAcl.

Updates (replace) the access control list.

public void
setOwner(UserPrincipal
the new file owner
owner
)

Implements java.nio.file.attribute.FileOwnerAttributeView.setOwner.

Updates the file owner.

Inherited from org.apache.sshd.sftp.client.impl.AbstractSftpFileAttributeView:
getPathproviderreadRemoteAttributeswriteRemoteAttributes

Constructor Detail

SftpAclFileAttributeViewback to summary
public SftpAclFileAttributeView(SftpFileSystemProvider provider, Path path, LinkOption... options)

Method Detail

getAclback to summary
public List<AclEntry> getAcl() throws IOException

Implements java.nio.file.attribute.AclFileAttributeView.getAcl.

Doc from java.nio.file.attribute.AclFileAttributeView.getAcl.

Reads the access control list.

When the file system uses an ACL model that differs from the NFSv4 defined ACL model, then this method returns an ACL that is the translation of the ACL to the NFSv4 ACL model.

The returned list is modifiable so as to facilitate changes to the existing ACL. The setAcl method is used to update the file's ACL attribute.

Returns:List<AclEntry>

an ordered list of entries representing the ACL

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
getOwnerback to summary
public UserPrincipal getOwner() throws IOException

Implements java.nio.file.attribute.FileOwnerAttributeView.getOwner.

Doc from java.nio.file.attribute.FileOwnerAttributeView.getOwner.

Read the file owner.

It is implementation specific if the file owner can be a group.

Returns:UserPrincipal

the file owner

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
nameback to summary
public String name()

Overrides org.apache.sshd.sftp.client.impl.AbstractSftpFileAttributeView.name.

Implements java.nio.file.attribute.AclFileAttributeView.name, java.nio.file.attribute.AttributeView.name.

Doc from java.nio.file.attribute.AclFileAttributeView.name.

Returns the name of the attribute view. Attribute views of this type have the name "acl".

Returns:String

Doc from java.nio.file.attribute.AttributeView.name.

the name of the attribute view

Annotations
@Override
setAclback to summary
public void setAcl(List<AclEntry> acl) throws IOException

Implements java.nio.file.attribute.AclFileAttributeView.setAcl.

Doc from java.nio.file.attribute.AclFileAttributeView.setAcl.

Updates (replace) the access control list.

Where the file system supports Access Control Lists, and it uses an ACL model that differs from the NFSv4 defined ACL model, then this method must translate the ACL to the model supported by the file system. This method should reject (by throwing IOException) any attempt to write an ACL that would appear to make the file more secure than would be the case if the ACL were updated. Where an implementation does not support a mapping of AclEntryType#AUDIT or AclEntryType#ALARM entries, then this method ignores these entries when writing the ACL.

If an ACL entry contains a user-principal that is not associated with the same provider as this attribute view then ProviderMismatchException is thrown. Additional validation, if any, is implementation dependent.

If the file system supports other security related file attributes (such as a file access-permissions for example), the updating the access control list may also cause these security related attributes to be updated.

Parameters
acl:List<AclEntry>

the new access control list

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs or the ACL is invalid
setOwnerback to summary
public void setOwner(UserPrincipal owner) throws IOException

Implements java.nio.file.attribute.FileOwnerAttributeView.setOwner.

Doc from java.nio.file.attribute.FileOwnerAttributeView.setOwner.

Updates the file owner.

It is implementation specific if the file owner can be a group. To ensure consistent and correct behavior across platforms it is recommended that this method should only be used to set the file owner to a user principal that is not a group.

Parameters
owner:UserPrincipal

the new file owner

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs, or the owner parameter is a group and this implementation does not support setting the owner to a group