public class AclEntry extends Object
An ACL for an object consists of a List
of Acl entries.
This class also provides a number of convenience methods for converting ACL entries and ACLs to and back from strings.
Modifier and Type | Field and Description |
---|---|
AclAction |
action
AclAction enum specifying the action permitted by this Acl entry. |
String |
name
String specifying the name of the user or group associated with this Acl entry.
|
AclScope |
scope
AclScope specifying scope of the Acl entry (access or default) |
AclType |
type
AclType specifying the type of the Acl entry (user, group, other or mask) |
Constructor and Description |
---|
AclEntry() |
AclEntry(AclScope scope,
AclType type,
String name,
AclAction action)
creates and Acl Entry from the supplied scope, type, name and action
|
Modifier and Type | Method and Description |
---|---|
static String |
aclListToString(List<AclEntry> list)
converts a
List <AclEntry> to its posix aclspec string form |
static String |
aclListToString(List<AclEntry> list,
boolean removeAcl)
converts a
List <AclEntry> to its posix aclspec string form. |
static AclEntry |
parseAclEntry(String entryString)
Parses an Acl entry from its posix string form.
|
static AclEntry |
parseAclEntry(String entryString,
boolean removeAcl)
Parses a single Acl entry from its posix string form.
|
static List<AclEntry> |
parseAclSpec(String aclString)
parses a posix acl spec string into a
List of AclEntry s. |
String |
toString()
Returns the posix string form of this acl entry.
|
String |
toString(boolean removeAcl)
Returns the posix string form of this acl entry.
|
public String name
public AclEntry()
public AclEntry(AclScope scope, AclType type, String name, AclAction action)
scope
- AclScope
specifying scope of the Acl entry (access or default)type
- AclType
specifying the type of the Acl entry (user, group, other or mask)name
- String specifying the name of the user or group associated with this Acl entryaction
- AclAction
specifying the action permitted by this Acl entrypublic static AclEntry parseAclEntry(String entryString) throws IllegalArgumentException
"default:user:bob:r-x"
entryString
- Acl entry string to parseAclEntry
parsed from the stringIllegalArgumentException
- if the string is invalidpublic static AclEntry parseAclEntry(String entryString, boolean removeAcl) throws IllegalArgumentException
"default:user:bob:r-x"
.
If the Acl string will be used to remove an existing acl from a file or folder, then the permission
level does not need to be specified. Passing false to the removeAcl
argument tells the parser
to accept such strings.
entryString
- Acl entry string to parseremoveAcl
- boolean specifying whether to parse this string like a remove Acl (that is, with
permission optional)AclEntry
parsed from the stringIllegalArgumentException
- if the string is invalidpublic String toString()
"default:user:bob:r-x"
.public String toString(boolean removeAcl)
"default:user:bob:r-x"
.
If the Acl string will be used to remove an existing acl from a file or folder, then the permission
level does not need to be specified. Passing true to the removeAcl
argument omits the permission
level in the output string.
removeAcl
- passing true will result in an acl entry string with no permission specifiedAclEntry
public static List<AclEntry> parseAclSpec(String aclString) throws IllegalArgumentException
List
of AclEntry
s.aclString
- the acl spec string tp parseList
<AclEntry>
represented by the acl spec stringIllegalArgumentException
public static String aclListToString(List<AclEntry> list)
List
<AclEntry>
to its posix aclspec string formlist
- List
<AclEntry>
to covert to stringpublic static String aclListToString(List<AclEntry> list, boolean removeAcl)
List
<AclEntry>
to its posix aclspec string form.
If the aclspec string will be used to remove an existing acl from a file or folder, then the permission
level does not need to be specified. Passing true to the removeAcl
argument omits the permission
level in the output string.
list
- List
<AclEntry>
to covert to stringremoveAcl
- removeAcl passing true will result in an aclspec with no permission specifiedCopyright © 2019 Microsoft Corporation. All rights reserved.