public class OpenFlags extends Object
OpenOption
s.
This class may be extended by file system implementations that add custom
options. Use setStandardOption(OpenFlags, OpenOption)
to set
standard options in custom subclasses.
StandardOpenOption
,
LinkOption
Modifier and Type | Field and Description |
---|---|
boolean |
append |
boolean |
create |
boolean |
createNew |
boolean |
deleteOnClose |
boolean |
dsync |
boolean |
followLinks |
boolean |
read |
boolean |
sparse |
boolean |
sync |
boolean |
truncateExisting |
boolean |
write |
Constructor and Description |
---|
OpenFlags() |
Modifier and Type | Method and Description |
---|---|
static OpenFlags |
fromOptions(Iterable<? extends OpenOption> options)
Converts the specified options to flags.
|
static OpenFlags |
fromOptions(OpenOption... options)
Converts the specified options to flags.
|
protected static boolean |
setStandardOption(OpenFlags flags,
OpenOption option)
Sets a standard option in
flags . |
static OpenFlags |
validateFromOptions(Iterable<? extends OpenOption> options)
Converts the specified options to flags, sets missing implied flags, and
checks for invalid combinations.
|
public boolean read
public boolean write
public boolean append
public boolean create
public boolean createNew
public boolean truncateExisting
public boolean deleteOnClose
public boolean sparse
public boolean dsync
public boolean sync
public boolean followLinks
public static OpenFlags validateFromOptions(Iterable<? extends OpenOption> options)
options
- the options to convert and validateIllegalArgumentException
- if the iterable contains an invalid
combination of optionsFiles.newByteChannel
public static OpenFlags fromOptions(OpenOption... options)
options
- the options to convertUnsupportedOperationException
- if an unsupported option is
specifiedpublic static OpenFlags fromOptions(Iterable<? extends OpenOption> options)
options
- the options to convertUnsupportedOperationException
- if an unsupported option is
specifiedprotected static boolean setStandardOption(OpenFlags flags, OpenOption option)
flags
.flags
- the flags object in which to set the optionoption
- the standard option to settrue
if the option was recognized and set or
false
if the option was non-standard.