Top Description Inners Fields Constructors Methods
java.nio.file.attribute

public final Class AclEntry

extends Object
Class Inheritance
Imports
java.util.*

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:

  1. The type component determines if the entry grants or denies access.

  2. The principal component, sometimes called the "who" component, is a UserPrincipal corresponding to the identity that the entry grants or denies access

  3. The permissions component is a set of permissions

  4. The flags component is a set of flags to indicate how entries are inherited and propagated

ACL entries are created using an associated Builder object by invoking its build method.

ACL entries are immutable and are safe for use by multiple concurrent threads.

Since
1.7
External Specification
https://www.rfc-editor.org/info/rfc3530

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
AclEntry.Builder

A builder of AclEntry objects.

Field Summary

Modifier and TypeField and Description
private final Set<AclEntryFlag>
private volatile int
private final Set<AclEntryPermission>
private final AclEntryType
private final UserPrincipal

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if, and only if, the given object is an AclEntry that is identical to this AclEntry
equals
(Object
the object to which this object is to be compared
ob
)

Overrides java.lang.Object.equals.

Compares the specified object with this ACL entry for equality.
public Set<AclEntryFlag>

Returns:

the flags component
flags
()

Returns a copy of the flags component.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns the hash-code value for this ACL entry.
public static AclEntry.Builder

Returns:

a new builder
newBuilder
()

Constructs a new builder.

public static AclEntry.Builder

Returns:

a new builder
newBuilder
(AclEntry
an ACL entry
entry
)

Constructs a new builder with the components of an existing ACL entry.

public Set<AclEntryPermission>

Returns:

the permissions component
permissions
()

Returns a copy of the permissions component.

public UserPrincipal

Returns:

the principal component
principal
()

Returns the principal component.

public String

Returns:

the string representation of this entry
toString
()

Overrides java.lang.Object.toString.

Returns the string representation of this ACL entry.
public AclEntryType

Returns:

the ACL entry type
type
()

Returns the ACL entry type.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

flagsback to summary
private final Set<AclEntryFlag> flags
hashback to summary
private volatile int hash
permsback to summary
private final Set<AclEntryPermission> perms
typeback to summary
private final AclEntryType type
whoback to summary
private final UserPrincipal who

Constructor Detail

AclEntryback to summary
private AclEntry(AclEntryType type, UserPrincipal who, Set<AclEntryPermission> perms, Set<AclEntryFlag> flags)

Method Detail

equalsback to summary
public boolean equals(Object ob)

Overrides java.lang.Object.equals.

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 method.

Parameters
ob:Object

the object to which this object is to be compared

Returns:boolean

true if, and only if, the given object is an AclEntry that is identical to this AclEntry

Annotations
@Override
flagsback to summary
public Set<AclEntryFlag> flags()

Returns a copy of the flags component.

The returned set is a modifiable copy of the flags.

Returns:Set<AclEntryFlag>

the flags component

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hash-code value for this ACL entry.

This method satisfies the general contract of the Object#hashCode method.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object

Annotations
@Override
newBuilderback to summary
public static AclEntry.Builder 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:AclEntry.Builder

a new builder

newBuilderback to summary
public static AclEntry.Builder newBuilder(AclEntry entry)

Constructs a new builder with the components of an existing ACL entry.

Parameters
entry:AclEntry

an ACL entry

Returns:AclEntry.Builder

a new builder

permissionsback to summary
public Set<AclEntryPermission> permissions()

Returns a copy of the permissions component.

The returned set is a modifiable copy of the permissions.

Returns:Set<AclEntryPermission>

the permissions component

principalback to summary
public UserPrincipal principal()

Returns the principal component.

Returns:UserPrincipal

the principal component

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns the string representation of this ACL entry.

Returns:String

the string representation of this entry

Annotations
@Override
typeback to summary
public AclEntryType type()

Returns the ACL entry type.

Returns:AclEntryType

the ACL entry type

java.nio.file.attribute back to summary

public final Class AclEntry.Builder

extends Object
Class Inheritance

A builder of AclEntry objects.

A Builder object is obtained by invoking one of the newBuilder methods defined by the AclEntry class.

Builder objects are mutable and are not safe for use by multiple concurrent threads without appropriate synchronization.

Since
1.7

Field Summary

Modifier and TypeField and Description
private Set<AclEntryFlag>
private Set<AclEntryPermission>
private AclEntryType
private UserPrincipal

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public AclEntry

Returns:

a new ACL entry
build
()

Constructs an AclEntry from the components of this builder.

private static void
checkSet(Set<?> set, Class<?> type)

public AclEntry.Builder

Returns:

this builder
setFlags
(Set<AclEntryFlag>
the flags component
flags
)

Sets the flags component of this builder.

public AclEntry.Builder

Returns:

this builder
setFlags
(AclEntryFlag...
the flags component
flags
)

Sets the flags component of this builder.

public AclEntry.Builder

Returns:

this builder
setPermissions
(Set<AclEntryPermission>
the permissions component
perms
)

Sets the permissions component of this builder.

public AclEntry.Builder

Returns:

this builder
setPermissions
(AclEntryPermission...
the permissions component
perms
)

Sets the permissions component of this builder.

public AclEntry.Builder

Returns:

this builder
setPrincipal
(UserPrincipal
the principal component
who
)

Sets the principal component of this builder.

public AclEntry.Builder

Returns:

this builder
setType
(AclEntryType
the component type
type
)

Sets the type component of this builder.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

flagsback to summary
private Set<AclEntryFlag> flags
permsback to summary
private Set<AclEntryPermission> perms
typeback to summary
private AclEntryType type
whoback to summary
private UserPrincipal who

Constructor Detail

Builderback to summary
private Builder(AclEntryType type, UserPrincipal who, Set<AclEntryPermission> perms, Set<AclEntryFlag> flags)

Method Detail

buildback to summary
public AclEntry build()

Constructs an AclEntry from the components of this builder. The type and who components are required to have been set in order to construct an AclEntry.

Returns:AclEntry

a new ACL entry

Exceptions
IllegalStateException:
if the type or who component have not been set
checkSetback to summary
private static void checkSet(Set<?> set, Class<?> type)
setFlagsback to summary
public AclEntry.Builder setFlags(Set<AclEntryFlag> flags)

Sets the flags component of this builder. On return, the flags component of this builder is a copy of the given set.

Parameters
flags:Set<AclEntryFlag>

the flags component

Returns:AclEntry.Builder

this builder

Exceptions
ClassCastException:
if the set contains elements that are not of type AclEntryFlag
setFlagsback to summary
public AclEntry.Builder setFlags(AclEntryFlag... flags)

Sets the flags component of this builder. On return, the flags component of this builder is a copy of the flags in the given array.

Parameters
flags:AclEntryFlag[]

the flags component

Returns:AclEntry.Builder

this builder

setPermissionsback to summary
public AclEntry.Builder setPermissions(Set<AclEntryPermission> perms)

Sets the permissions component of this builder. On return, the permissions component of this builder is a copy of the given set.

Parameters
perms:Set<AclEntryPermission>

the permissions component

Returns:AclEntry.Builder

this builder

Exceptions
ClassCastException:
if the set contains elements that are not of type AclEntryPermission
setPermissionsback to summary
public AclEntry.Builder setPermissions(AclEntryPermission... perms)

Sets the permissions component of this builder. On return, the permissions component of this builder is a copy of the permissions in the given array.

Parameters
perms:AclEntryPermission[]

the permissions component

Returns:AclEntry.Builder

this builder

setPrincipalback to summary
public AclEntry.Builder setPrincipal(UserPrincipal who)

Sets the principal component of this builder.

Parameters
who:UserPrincipal

the principal component

Returns:AclEntry.Builder

this builder

setTypeback to summary
public AclEntry.Builder setType(AclEntryType type)

Sets the type component of this builder.

Parameters
type:AclEntryType

the component type

Returns:AclEntry.Builder

this builder