Package org.xmldb.api.security
Class Permissions
- java.lang.Object
-
- org.xmldb.api.security.Permissions
-
public final class Permissions extends java.lang.ObjectParser forPermissionvalues. This class provides static methods to parse string and integer based permission modes into a set of permissions.- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.regex.PatternSIMPLE_SYMBOLIC_MODE_PATTERNstatic java.util.regex.PatternUNIX_SYMBOLIC_MODE_PATTERN
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Set<Permission>fromModeString(java.lang.String modeStr)Parses the permissions from the given mode string.static java.util.Set<Permission>fromOctal(int mode)Parses the permissions from the given octal mode value.
-
-
-
Method Detail
-
fromModeString
public static java.util.Set<Permission> fromModeString(java.lang.String modeStr)
Parses the permissions from the given mode string. The string can either be in one of two formats:- Unix Symbolic format as given to 'chmod' on Unix/Linux
- Simple Symbolic format e.g. "rwxr-xr-x"
- Parameters:
modeStr- the mode to be parsed- Returns:
- the set of parsed permissions
- Throws:
java.lang.IllegalArgumentException- if the given mode string is in the wrong format
-
fromOctal
public static java.util.Set<Permission> fromOctal(int mode)
Parses the permissions from the given octal mode value.- Parameters:
mode- the octal permission mode- Returns:
- the set of parsed permissions
-
-