org.apache.hadoop.fs.permission
Class AclEntry

java.lang.Object
  extended by org.apache.hadoop.fs.permission.AclEntry

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class AclEntry
extends Object

Defines a single entry in an ACL. An ACL entry has a type (user, group, mask, or other), an optional name (referring to a specific user or group), a set of permissions (any combination of read, write and execute), and a scope (access or default). AclEntry instances are immutable. Use a AclEntry.Builder to create a new instance.


Method Summary
static String aclSpecToString(List<AclEntry> aclSpec)
          Convert a List of AclEntries into a string - the reverse of parseAclSpec.
 boolean equals(Object o)
           
 String getName()
          Returns the optional ACL entry name.
 FsAction getPermission()
          Returns the set of permissions in the ACL entry.
 AclEntryScope getScope()
          Returns the scope of the ACL entry.
 AclEntryType getType()
          Returns the ACL entry type.
 int hashCode()
           
static AclEntry parseAclEntry(String aclStr, boolean includePermission)
          Parses a string representation of an ACL into a AclEntry object.
static List<AclEntry> parseAclSpec(String aclSpec, boolean includePermission)
          Parses a string representation of an ACL spec into a list of AclEntry objects.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getType

public AclEntryType getType()
Returns the ACL entry type.

Returns:
AclEntryType ACL entry type

getName

public String getName()
Returns the optional ACL entry name.

Returns:
String ACL entry name, or null if undefined

getPermission

public FsAction getPermission()
Returns the set of permissions in the ACL entry.

Returns:
FsAction set of permissions in the ACL entry

getScope

public AclEntryScope getScope()
Returns the scope of the ACL entry.

Returns:
AclEntryScope scope of the ACL entry

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

parseAclSpec

public static List<AclEntry> parseAclSpec(String aclSpec,
                                          boolean includePermission)
Parses a string representation of an ACL spec into a list of AclEntry objects. Example: "user::rwx,user:foo:rw-,group::r--,other::---"

Parameters:
aclSpec - String representation of an ACL spec.
includePermission - for setAcl operations this will be true. i.e. AclSpec should include permissions.
But for removeAcl operation it will be false. i.e. AclSpec should not contain permissions.
Example: "user:foo,group:bar"
Returns:
Returns list of AclEntry parsed

parseAclEntry

public static AclEntry parseAclEntry(String aclStr,
                                     boolean includePermission)
Parses a string representation of an ACL into a AclEntry object.

Parameters:
aclStr - String representation of an ACL.
Example: "user:foo:rw-"
includePermission - for setAcl operations this will be true. i.e. Acl should include permissions.
But for removeAcl operation it will be false. i.e. Acl should not contain permissions.
Example: "user:foo,group:bar,mask::"
Returns:
Returns an AclEntry object

aclSpecToString

public static String aclSpecToString(List<AclEntry> aclSpec)
Convert a List of AclEntries into a string - the reverse of parseAclSpec.

Parameters:
aclSpec - List of AclEntries to convert
Returns:
String representation of aclSpec


Copyright © 2014 Apache Software Foundation. All Rights Reserved.