public enum Flags extends Enum<Flags>
int flags = Flags.EXCL.or(Flags.READ.or(Flags.WRITE));
if (Flags.READ.isSet(flags)) ...
Enum Constant and Description |
---|
ALLFILEFLAGS
All flags applicable to the file package.
|
ALLLOGICALFILEFLAGS
All flags applicable to the logical file package.
|
ALLNAMESPACEFLAGS
All flags applicable to the namespace package.
|
APPEND
Upon opening, the file pointer is set to the end of the file.
|
BINARY
For OS-es that distinguish between binary and non-binary modes.
|
CREATE
Allows a namespace entry to be created while opening it, if it does not
already exist.
|
CREATEPARENTS
Implies that missing path elements are created on the fly.
|
DEREFERENCE
Enforces an operation to apply not to the entry pointed to by the target name,
but to the link target of that entry.
|
EXCL
If the entry already exists, the
CREATE flag is not silenty
ignored. |
LOCK
Enforces a lock on the namespace entry when it is opened.
|
NONE
Indicates the absence of flags.
|
OVERWRITE
Enforces an operation which creates a new namespace entry to continue
even if the target entry does not already exist.
|
READ
The file or directory is opened for reading.
|
READWRITE
The file or directory is opened for reading and writing.
|
RECURSIVE
Enforces an operation to apply recursively on a directory tree.
|
TRUNCATE
Upon opening, the file is truncated to length 0.
|
WRITE
The file or directory is opened for writing.
|
Modifier and Type | Method and Description |
---|---|
int |
getValue()
Returns the integer value of this enumeration literal.
|
boolean |
isSet(int val)
Tests for the presence of this flag in the specified value.
|
int |
or(Flags val)
Returns the result of or-ing this flag into another.
|
int |
or(int val)
Returns the result of or-ing this flag into an integer.
|
static Flags |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Flags[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Flags NONE
public static final Flags OVERWRITE
public static final Flags RECURSIVE
public static final Flags DEREFERENCE
public static final Flags CREATE
public static final Flags EXCL
CREATE
flag is not silenty
ignored. Instead, an AlreadyExistsException
is raised.public static final Flags LOCK
public static final Flags CREATEPARENTS
public static final Flags TRUNCATE
public static final Flags APPEND
public static final Flags READ
public static final Flags WRITE
public static final Flags READWRITE
public static final Flags ALLNAMESPACEFLAGS
public static final Flags BINARY
public static final Flags ALLLOGICALFILEFLAGS
public static final Flags ALLFILEFLAGS
public static Flags[] values()
for (Flags c : Flags.values()) System.out.println(c);
public static Flags valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getValue()
public int or(int val)
val
- the value to OR this enumeration value into.public int or(Flags val)
val
- the value to OR this enumeration value into.public boolean isSet(int val)
val
- the value.true
if this flag is present.Copyright © 2016 Open Grid Forum. All rights reserved.