@PublicApi @NotThreadSafe public final class Mode extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Mode.Bits
Mode bits.
|
Constructor and Description |
---|
Mode(Mode.Bits ownerBits,
Mode.Bits groupBits,
Mode.Bits otherBits)
|
Mode(Mode mode)
Copy constructor.
|
Mode(short mode)
Constructs an instance of
Mode with the given mode. |
Modifier and Type | Method and Description |
---|---|
Mode |
applyDirectoryUMask()
Applies the default umask for newly created directories to this mode.
|
Mode |
applyFileUMask()
Applies the default umask for newly created files to this mode.
|
static Mode |
createFullAccess()
Creates the "full access" mode.
|
static Mode |
createNoAccess()
Creates the "no access" mode.
|
static Mode |
defaults()
Gets the default mode.
|
boolean |
equals(Object obj) |
static Mode.Bits |
extractGroupBits(short mode) |
static Mode.Bits |
extractOtherBits(short mode) |
static Mode.Bits |
extractOwnerBits(short mode) |
void |
fromShort(short n)
Sets
Mode bits using a digital representation. |
Mode.Bits |
getGroupBits() |
Mode.Bits |
getOtherBits() |
Mode.Bits |
getOwnerBits() |
static Mode |
getUMask(String confUmask)
Gets the file / directory creation umask.
|
int |
hashCode() |
void |
setGroupBits(Mode.Bits bits)
Sets group bits.
|
void |
setOtherBits(Mode.Bits bits)
Sets other bits.
|
void |
setOwnerBits(Mode.Bits bits)
Sets owner bits.
|
short |
toShort()
Encodes the object as a short.
|
String |
toString() |
public Mode(short mode)
Mode
with the given mode.public static Mode createNoAccess()
Mode
public static Mode createFullAccess()
Mode
public static Mode.Bits extractOwnerBits(short mode)
public void setOwnerBits(Mode.Bits bits)
bits
- the owner bits to setpublic static Mode.Bits extractGroupBits(short mode)
public void setGroupBits(Mode.Bits bits)
bits
- the group bits to setpublic static Mode.Bits extractOtherBits(short mode)
public void setOtherBits(Mode.Bits bits)
bits
- the other bits to setpublic void fromShort(short n)
Mode
bits using a digital representation.n
- the digital representation of a Mode
public short toShort()
Mode
public Mode applyFileUMask()
public Mode applyDirectoryUMask()
Copyright © 2023. All Rights Reserved.