public enum OpenOption extends java.lang.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 |
---|---|
boolean |
occursIn(OpenOption... options)
Check if a sequence of
OpenOption s contains this option. |
static OpenOption |
valueOf(java.lang.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(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic boolean occursIn(OpenOption... options)
OpenOption
s contains this option.
If options
is null
, false
will be returned.options
- the array to check.options
contains option
.