public class FilePermission extends Object
Modifier and Type | Field and Description |
---|---|
static int |
EXECUTE
Execute permissions = 1.
|
private int |
group |
static int |
NONE
No permissions = 0;
|
private int |
other |
static int |
READ
Read permissions = 4.
|
private int |
user |
static FilePermission |
USER_RW
Predefined set of permission giving the owner READ+WRITE permission and
no permissions to other users.
|
static FilePermission |
USER_RW_ALL_R
Predefined set of permission giving the owner READ+WRITE permission and
READ permissions to other users.
|
static FilePermission |
USER_RW_GROUP_R
Predefined set of permission giving the owner READ+WRITE permission, the
group READ permission and no permissions to other users.
|
static FilePermission |
USER_RWX
Predefined set of permission giving the owner READ+WRITE+EXECUTE permission and
no permissions to other users.
|
static int |
WRITE
Write permissions = 2.
|
Constructor and Description |
---|
FilePermission(int user,
int group,
int other)
Create a new set of permissions for the owner, group and all other users.
|
Modifier and Type | Method and Description |
---|---|
String |
chmod()
Get the octal permission representation to set in 'chmod' command.
|
boolean |
equals(Object obj) |
int |
getGroupPermission()
Get the group permission.
|
int |
getOtherPermission()
Get the permission for other users.
|
int |
getPermissions()
Get the combined permissions.
|
int |
getUserPermission()
Get the user (owner) permission.
|
int |
hashCode() |
String |
umask()
Get the octal permission representation to set in 'umask' command.
|
public static final int NONE
public static final int READ
public static final int WRITE
public static final int EXECUTE
public static final FilePermission USER_RW
public static final FilePermission USER_RWX
public static final FilePermission USER_RW_GROUP_R
public static final FilePermission USER_RW_ALL_R
private final int user
private final int group
private final int other
public FilePermission(int user, int group, int other)
public int getUserPermission()
public int getGroupPermission()
public int getOtherPermission()
public int getPermissions()
public String chmod()
public String umask()