|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrailo.commons.io.ModeUtil
public final class ModeUtil
Field Summary | |
---|---|
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 Summary | |
---|---|
ModeUtil()
|
Method Summary | |
---|---|
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) |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public ModeUtil()
Method Detail |
---|
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |