public final class AccessControlParser extends Object
AccessControlLists to/from XML.| Modifier and Type | Field and Description |
|---|---|
static String |
ACE
ACE constant used in JSON formatted access control entries
|
static String |
ACL
ACL constant used in JSON formatted access control entries
|
static String |
ACTION
Action constant used in JSON formatted access control entries
|
static String |
ALLOW
Allow constant used in JSON formatted access control entries
|
static String |
ENCODING
Encoding expected from all inputs
|
static Function<String,Either<Exception,AccessControlList>> |
parseAcl
Functional version of
parseAcl(String). |
static Function<String,AccessControlList> |
parseAclSilent
parseAclSilent(String) as a function. |
static String |
ROLE
Role constant used in JSON formatted access control entries
|
static Function<AccessControlList,String> |
toJsonSilent |
| Modifier and Type | Method and Description |
|---|---|
static AccessControlList |
parseAcl(InputStream in)
Unmarshals an ACL from an xml input stream.
|
static AccessControlList |
parseAcl(String serializedForm)
Parses a string into an ACL.
|
static AccessControlList |
parseAclSilent(String serializedForm)
Same like
parseAcl(String) but throws runtime exceptions in case of an error. |
static String |
toJson(AccessControlList acl) |
static String |
toJsonSilent(AccessControlList acl) |
static String |
toXml(AccessControlList acl)
Serializes an AccessControlList to its XML form.
|
public static final String ROLE
public static final String ACTION
public static final String ALLOW
public static final String ACL
public static final String ACE
public static final String ENCODING
public static final Function<String,AccessControlList> parseAclSilent
parseAclSilent(String) as a function.public static final Function<String,Either<Exception,AccessControlList>> parseAcl
parseAcl(String).public static final Function<AccessControlList,String> toJsonSilent
public static AccessControlList parseAcl(String serializedForm) throws IOException, AccessControlParsingException
serializedForm - the string containing the xml or json formatted access control list.IOException - if the encoding is invalidAccessControlParsingException - if the format is invalidpublic static AccessControlList parseAclSilent(String serializedForm)
parseAcl(String) but throws runtime exceptions in case of an error.public static AccessControlList parseAcl(InputStream in) throws IOException, AccessControlParsingException
in - the xml input streamIOException - if there is a problem unmarshaling the streamAccessControlParsingException - if the format is invalidpublic static String toXml(AccessControlList acl) throws IOException
acl - the access control listIOException - if there is a problem marshaling the xmlpublic static String toJson(AccessControlList acl) throws IOException
IOExceptionpublic static String toJsonSilent(AccessControlList acl)
Copyright © 2009–2020 Opencast Project. All rights reserved.