Modifier and Type | Field and Description |
---|---|
static int |
PERM_EXECUTE |
static int |
PERM_READ |
static int |
PERM_WRITE |
static int |
ROLE_GROUP |
static int |
ROLE_OWNER |
static int |
ROLE_WORLD |
Constructor and Description |
---|
ModeUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
hasPermission(int role,
int permission,
int mode)
check mode for a specific permission
|
static boolean |
isExecutable(int octalMode)
check if mode is executable for owner
|
static boolean |
isReadable(int octalMode)
check if mode is readable for owner
|
static boolean |
isWritable(int octalMode)
check if mode is writeable for owner
|
static void |
main(String[] args) |
static int |
setExecutable(int octalMode,
boolean value) |
static int |
setReadable(int octalMode,
boolean value) |
static int |
setWritable(int octalMode,
boolean value) |
static int |
toOctalMode(String strMode)
translate a string mode (777 or drwxrwxrwx to a octal value)
|
static String |
toStringMode(int octalMode)
translate a octal mode value (73) to a string representation ("111")
|
static int |
updateMode(int existingOctal,
int updateOctal)
update octal mode with a other
|
static String |
updateMode(String existing,
String update)
update a string mode with a other (111+222=333 or 333+111=333 or 113+202=313)
|
public static final int PERM_READ
public static final int PERM_WRITE
public static final int PERM_EXECUTE
public static final int ROLE_OWNER
public static final int ROLE_GROUP
public static final int ROLE_WORLD
public ModeUtil()
public static int toOctalMode(String strMode) throws IOException
strMode
- IOException
public static String toStringMode(int octalMode)
strMode
- public static String updateMode(String existing, String update) throws IOException
existing
- update
- IOException
public static int updateMode(int existingOctal, int updateOctal)
existingOctal
- updateOctal
- public static boolean hasPermission(int role, int permission, int mode)
role
- permission
- mode
- public static boolean isReadable(int octalMode)
octalMode
- public static boolean isWritable(int octalMode)
octalMode
- public static boolean isExecutable(int octalMode)
octalMode
- public static int setReadable(int octalMode, boolean value)
public static int setWritable(int octalMode, boolean value)
public static int setExecutable(int octalMode, boolean value)
public static void main(String[] args) throws IOException
IOException
Copyright © 2015 Lucee