public final class AclEntry extends Object
The ACL entry represented by this class is based on the ACL model specified in RFC 3530: Network File System (NFS) version 4 Protocol. Each entry has four components as follows:
The type
component determines if the entry grants or denies access.
The principal
component, sometimes called the "who" component, is a UserPrincipal
corresponding to the identity that the entry grants or denies access
The permissions
component is a set of permissions
The flags
component is a set of flags
to indicate how entries are inherited and propagated
ACL entries are created using an associated AclEntry.Builder
object by invoking its build
method.
ACL entries are immutable and are safe for use by multiple concurrent threads.
Modifier and Type | Class | Description |
---|---|---|
static final class |
AclEntry.Builder |
A builder of AclEntry objects. |
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals |
Compares the specified object with this ACL entry for equality. |
Set |
flags() |
Returns a copy of the flags component. |
int |
hashCode() |
Returns the hash-code value for this ACL entry. |
static AclEntry.Builder |
newBuilder() |
Constructs a new builder. |
static AclEntry.Builder |
newBuilder |
Constructs a new builder with the components of an existing ACL entry. |
Set |
permissions() |
Returns a copy of the permissions component. |
UserPrincipal |
principal() |
Returns the principal component. |
String |
toString() |
Returns the string representation of this ACL entry. |
AclEntryType |
type() |
Returns the ACL entry type. |
public static AclEntry.Builder newBuilder()
null
. The initial value of the permissions and flags components is the empty set.public static AclEntry.Builder newBuilder(AclEntry entry)
entry
- an ACL entrypublic AclEntryType type()
public UserPrincipal principal()
public Set<AclEntryPermission> permissions()
The returned set is a modifiable copy of the permissions.
public Set<AclEntryFlag> flags()
The returned set is a modifiable copy of the flags.
public boolean equals(Object ob)
If the given object is not an AclEntry
then this method immediately returns false
.
For two ACL entries to be considered equals requires that they are both the same type, their who components are equal, their permissions components are equal, and their flags components are equal.
This method satisfies the general contract of the Object.equals
method.
public int hashCode()
This method satisfies the general contract of the Object.hashCode()
method.
public String toString()
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/file/attribute/AclEntry.html