public class PosixPermissions extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static class |
PosixPermissions.Type |
Permission types.
|
Constructor | Description |
---|---|
PosixPermissions(int permissions,
boolean isOwner,
boolean isInGroup) |
Creates a new PosixPermissions object.
|
Modifier and Type | Method | Description |
---|---|---|
int |
getPermissions() |
Gets permissions.
|
boolean |
isExecutable() |
Gets whether the permissions are executable.
|
boolean |
isReadable() |
Gets whether the permissions are readable.
|
boolean |
isWritable() |
Gets whether the permissions are writable.
|
int |
makeExecutable(boolean executable,
boolean ownerOnly) |
Creates new permissions based on these permissions.
|
java.lang.Integer |
makeReadable(boolean readable,
boolean ownerOnly) |
Creates new permissions based on these permissions.
|
java.lang.Integer |
makeWritable(boolean writable,
boolean ownerOnly) |
Creates new permissions based on these permissions.
|
public PosixPermissions(int permissions, boolean isOwner, boolean isInGroup)
permissions
- The permissionsisOwner
- true if the user is the owner of the fileisInGroup
- true if the user is a group owner of the filepublic int getPermissions()
public boolean isExecutable()
public boolean isReadable()
public boolean isWritable()
public int makeExecutable(boolean executable, boolean ownerOnly)
executable
- Whether the new permissions should be readable.ownerOnly
- Whether the new permissions are only for the owner.public java.lang.Integer makeReadable(boolean readable, boolean ownerOnly)
readable
- Whether the new permissions should be readable.ownerOnly
- Whether the new permissions are only for the owner.public java.lang.Integer makeWritable(boolean writable, boolean ownerOnly)
writable
- Whether the new permissions should be readable.ownerOnly
- Whether the new permissions are only for the owner.