AclEntry (Java Platform SE 8 ) (original) (raw)
- java.nio.file.attribute.AclEntry
public final class AclEntry
extends Object
An entry in an access control list (ACL).
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 ofpermissions
- 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.
Since:
1.7
Nested Class Summary
Nested Classes
Modifier and Type Class Description static class AclEntry.Builder A builder of AclEntry objects. Method Summary
All Methods Static Methods Instance Methods Concrete Methods
Modifier and Type Method Description boolean equals(Object ob) Compares the specified object with this ACL entry for equality. Set<AclEntryFlag> 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(AclEntry entry) Constructs a new builder with the components of an existing ACL entry. Set<AclEntryPermission> 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. * ### Methods inherited from class java.lang.[Object](../../../../java/lang/Object.html "class in java.lang") `[clone](../../../../java/lang/Object.html#clone--), [finalize](../../../../java/lang/Object.html#finalize--), [getClass](../../../../java/lang/Object.html#getClass--), [notify](../../../../java/lang/Object.html#notify--), [notifyAll](../../../../java/lang/Object.html#notifyAll--), [wait](../../../../java/lang/Object.html#wait--), [wait](../../../../java/lang/Object.html#wait-long-), [wait](../../../../java/lang/Object.html#wait-long-int-)`
Method Detail
* #### newBuilder public static [AclEntry.Builder](../../../../java/nio/file/attribute/AclEntry.Builder.html "class in java.nio.file.attribute") newBuilder() Constructs a new builder. The initial value of the type and who components is `null`. The initial value of the permissions and flags components is the empty set. Returns: a new builder * #### newBuilder public static [AclEntry.Builder](../../../../java/nio/file/attribute/AclEntry.Builder.html "class in java.nio.file.attribute") newBuilder([AclEntry](../../../../java/nio/file/attribute/AclEntry.html "class in java.nio.file.attribute") entry) Constructs a new builder with the components of an existing ACL entry. Parameters: `entry` \- an ACL entry Returns: a new builder * #### type public [AclEntryType](../../../../java/nio/file/attribute/AclEntryType.html "enum in java.nio.file.attribute") type() Returns the ACL entry type. Returns: the ACL entry type * #### principal public [UserPrincipal](../../../../java/nio/file/attribute/UserPrincipal.html "interface in java.nio.file.attribute") principal() Returns the principal component. Returns: the principal component * #### permissions public [Set](../../../../java/util/Set.html "interface in java.util")<[AclEntryPermission](../../../../java/nio/file/attribute/AclEntryPermission.html "enum in java.nio.file.attribute")> permissions() Returns a copy of the permissions component. The returned set is a modifiable copy of the permissions. Returns: the permissions component * #### flags public [Set](../../../../java/util/Set.html "interface in java.util")<[AclEntryFlag](../../../../java/nio/file/attribute/AclEntryFlag.html "enum in java.nio.file.attribute")> flags() Returns a copy of the flags component. The returned set is a modifiable copy of the flags. Returns: the flags component * #### equals public boolean equals([Object](../../../../java/lang/Object.html "class in java.lang") ob) Compares the specified object with this ACL entry for equality. 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](../../../../java/lang/Object.html#equals-java.lang.Object-) method. Overrides: `[equals](../../../../java/lang/Object.html#equals-java.lang.Object-)` in class `[Object](../../../../java/lang/Object.html "class in java.lang")` Parameters: `ob` \- the object to which this object is to be compared Returns: `true` if, and only if, the given object is an AclEntry that is identical to this AclEntry See Also: [Object.hashCode()](../../../../java/lang/Object.html#hashCode--), [HashMap](../../../../java/util/HashMap.html "class in java.util") * #### hashCode public int hashCode() Returns the hash-code value for this ACL entry. This method satisfies the general contract of the [Object.hashCode()](../../../../java/lang/Object.html#hashCode--) method. Overrides: `[hashCode](../../../../java/lang/Object.html#hashCode--)` in class `[Object](../../../../java/lang/Object.html "class in java.lang")` Returns: a hash code value for this object. See Also: [Object.equals(java.lang.Object)](../../../../java/lang/Object.html#equals-java.lang.Object-), [System.identityHashCode(java.lang.Object)](../../../../java/lang/System.html#identityHashCode-java.lang.Object-) * #### toString public [String](../../../../java/lang/String.html "class in java.lang") toString() Returns the string representation of this ACL entry. Overrides: `[toString](../../../../java/lang/Object.html#toString--)` in class `[Object](../../../../java/lang/Object.html "class in java.lang")` Returns: the string representation of this entry
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.