Constructor and Description |
---|
FileModeImpl(int mode)
Creates the mode of a file.
|
Modifier and Type | Method and Description |
---|---|
int |
getMode()
Returns the mode as number including all octals.
|
String |
getOctal()
Returns the mode as an octal number consisting only of the last 3 octals.
|
int |
getStickyBit()
Returns the sticky bit.
|
String |
getText()
Returns the mode as textual representation excluding the "sticky
bit".
|
boolean |
isGroupExecutable()
Returns the flag if the group can execute the file.
|
boolean |
isGroupReadable()
Returns the flag if the group can read the file.
|
boolean |
isGroupWriteable()
Returns the flag if the group can write the file.
|
boolean |
isOtherExecutable()
Returns the flag if the others can execute the file.
|
boolean |
isOtherReadable()
Returns the flag if the others can read the file.
|
boolean |
isOtherWriteable()
Returns the flag if the others can write the file.
|
boolean |
isOwnerExecutable()
Returns the flag if the owner can execute the file.
|
boolean |
isOwnerReadable()
Returns the flag if the owner can read the file.
|
boolean |
isOwnerWriteable()
Returns the flag if the owner can write the file.
|
public FileModeImpl(int mode)
Creates the mode of a file.
mode
- The mode: A number from octal 00000 (decimal: 0) to octal
777777 (decimal: 262143).public int getMode()
FileMode
Returns the mode as number including all octals.
public String getOctal()
FileMode
Returns the mode as an octal number consisting only of the last 3 octals.
The returned value may look like this:
777
or like this:
000
public String getText()
FileMode
Returns the mode as textual representation excluding the "sticky bit".
The returned value may look like this:
rwxrwxrwx
or like this:
---------
public int getStickyBit()
FileMode
Returns the sticky bit.
See Changing permission behavior with setuid, setgid, and sticky bits for more information.
getStickyBit
in interface FileMode
public boolean isOwnerReadable()
FileMode
Returns the flag if the owner can read the file.
isOwnerReadable
in interface FileMode
true
, if the owner can, false
otherwise.public boolean isOwnerWriteable()
FileMode
Returns the flag if the owner can write the file.
isOwnerWriteable
in interface FileMode
true
, if the owner can, false
otherwise.public boolean isOwnerExecutable()
FileMode
Returns the flag if the owner can execute the file.
isOwnerExecutable
in interface FileMode
true
, if the owner can, false
otherwise.public boolean isGroupReadable()
FileMode
Returns the flag if the group can read the file.
isGroupReadable
in interface FileMode
true
, if the group can, false
otherwise.public boolean isGroupWriteable()
FileMode
Returns the flag if the group can write the file.
isGroupWriteable
in interface FileMode
true
, if the group can, false
otherwise.public boolean isGroupExecutable()
FileMode
Returns the flag if the group can execute the file.
isGroupExecutable
in interface FileMode
true
, if the group can, false
otherwise.public boolean isOtherReadable()
FileMode
Returns the flag if the others can read the file.
isOtherReadable
in interface FileMode
true
, if the others can,
false
otherwise.public boolean isOtherWriteable()
FileMode
Returns the flag if the others can write the file.
isOtherWriteable
in interface FileMode
true
, if the others can,
false
otherwise.public boolean isOtherExecutable()
FileMode
Returns the flag if the others can execute the file.
isOtherExecutable
in interface FileMode
true
, if the others can,
false
otherwise.Copyright © 2015–2019. All rights reserved.