|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.fs.permission.FsPermission
public class FsPermission
A class for file/directory permissions.
Field Summary | |
---|---|
static int |
DEFAULT_UMASK
|
static String |
DEPRECATED_UMASK_LABEL
umask property label |
static String |
UMASK_LABEL
|
Constructor Summary | |
---|---|
FsPermission(FsAction u,
FsAction g,
FsAction o)
Construct by the given FsAction . |
|
FsPermission(FsPermission other)
Copy constructor |
|
FsPermission(short mode)
Construct by the given mode. |
|
FsPermission(String mode)
Construct by given mode, either in octal or symbolic format. |
Method Summary | |
---|---|
FsPermission |
applyUMask(FsPermission umask)
Apply a umask to this permission and return a new one |
static FsPermission |
createImmutable(short permission)
Create an immutable FsPermission object. |
boolean |
equals(Object obj)
|
void |
fromShort(short n)
|
static FsPermission |
getDefault()
Get the default permission. |
FsAction |
getGroupAction()
Return group FsAction . |
FsAction |
getOtherAction()
Return other FsAction . |
static FsPermission |
getUMask(Configuration conf)
Get the user file creation mask (umask) UMASK_LABEL config param has umask value that is either symbolic
or octal. |
FsAction |
getUserAction()
Return user FsAction . |
int |
hashCode()
|
static FsPermission |
read(DataInput in)
Create and initialize a FsPermission from DataInput . |
void |
readFields(DataInput in)
Deserialize the fields of this object from in . |
static void |
setUMask(Configuration conf,
FsPermission umask)
Set the user file creation mask (umask) |
short |
toShort()
Encode the object to a short. |
String |
toString()
|
static FsPermission |
valueOf(String unixSymbolicPermission)
Create a FsPermission from a Unix symbolic permission string |
void |
write(DataOutput out)
Serialize the fields of this object to out . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DEPRECATED_UMASK_LABEL
public static final String UMASK_LABEL
public static final int DEFAULT_UMASK
Constructor Detail |
---|
public FsPermission(FsAction u, FsAction g, FsAction o)
FsAction
.
u
- user actiong
- group actiono
- other actionpublic FsPermission(short mode)
mode
- toShort()
public FsPermission(FsPermission other)
other
- other permissionpublic FsPermission(String mode)
mode
- mode as a string, either in octal or symbolic format
IllegalArgumentException
- if mode
is invalidMethod Detail |
---|
public static FsPermission createImmutable(short permission)
FsPermission
object.
public FsAction getUserAction()
FsAction
.
public FsAction getGroupAction()
FsAction
.
public FsAction getOtherAction()
FsAction
.
public void fromShort(short n)
public void write(DataOutput out) throws IOException
out
.
write
in interface Writable
out
- DataOuput
to serialize this object into.
IOException
public void readFields(DataInput in) throws IOException
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields
in interface Writable
in
- DataInput
to deseriablize this object from.
IOException
public static FsPermission read(DataInput in) throws IOException
FsPermission
from DataInput
.
IOException
public short toShort()
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public FsPermission applyUMask(FsPermission umask)
public static FsPermission getUMask(Configuration conf)
UMASK_LABEL
config param has umask value that is either symbolic
or octal.
Symbolic umask is applied relative to file mode creation mask;
the permission op characters '+' clears the corresponding bit in the mask,
'-' sets bits in the mask.
Octal umask, the specified bits are set in the file mode creation mask.
DEPRECATED_UMASK_LABEL
config param has umask value set to decimal.
public static void setUMask(Configuration conf, FsPermission umask)
public static FsPermission getDefault()
public static FsPermission valueOf(String unixSymbolicPermission)
unixSymbolicPermission
- e.g. "-rw-rw-rw-"
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |