public enum OpenOption extends Enum<OpenOption>
Enum Constant and Description |
---|
APPEND
If the file is opened for WRITE access then bytes will be written to the end of the file rather than the beginning.
|
CREATE
Create a new file, failing if the file already exists.
|
OPEN
Open an existing file, failing if the file does not exist.
|
OPEN_OR_CREATE
Open an existing file or create a new file if it does not exist.
|
READ
Open for read access.
|
TRUNCATE
If the file is opened for WRITE access, then its length is truncated to 0.
|
WRITE
Open for write access.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
contains(OpenOption toFind,
OpenOption... options)
Check if a sequence of
OpenOption s contains a specific option. |
static OpenOption |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static OpenOption[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final OpenOption CREATE
public static final OpenOption OPEN
public static final OpenOption OPEN_OR_CREATE
public static final OpenOption APPEND
public static final OpenOption TRUNCATE
public static final OpenOption READ
public static final OpenOption WRITE
public static OpenOption[] values()
for (OpenOption c : OpenOption.values()) System.out.println(c);
public static OpenOption 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 static boolean contains(OpenOption toFind, OpenOption... options)
OpenOption
s contains a specific option.
If option
or options is null
, false
will be returned.
toFind
- the option to check for.options
- the array to check.options
contains option.