Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_APPEND
Whether the file should be opened in append mode by default = false.
|
static boolean |
DEFAULT_CREATE |
static boolean |
DEFAULT_CREATENEW |
static boolean |
DEFAULT_DELETEONCLOSE |
static boolean |
DEFAULT_DSYNC |
static String |
DEFAULT_PERMS |
static boolean |
DEFAULT_READ |
static boolean |
DEFAULT_SPARSE |
static boolean |
DEFAULT_SYNC |
static boolean |
DEFAULT_TRUNCATEEXISTING |
static boolean |
DEFAULT_WRITE |
Constructor and Description |
---|
OpenOptions()
Default constructor
|
OpenOptions(JsonObject json)
Constructor to create options from JSON
|
OpenOptions(OpenOptions other)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
String |
getPerms()
Get the permissions string to be used if creating a file
|
boolean |
isAppend() |
boolean |
isCreate()
Should the file be created if it does not already exist?
|
boolean |
isCreateNew()
Should the file be created if and the open fail if it already exists?
|
boolean |
isDeleteOnClose()
Should the file be deleted when it's closed, or the JVM is shutdown.
|
boolean |
isDsync()
If true then every write to the file's content will be written synchronously to the underlying hardware.
|
boolean |
isRead()
Is the file to opened for reading?
|
boolean |
isSparse()
Set whether a hint should be provided that the file to created is sparse
|
boolean |
isSync()
If true then every write to the file's content and metadata will be written synchronously to the underlying hardware.
|
boolean |
isTruncateExisting()
If the file exists and is opened for writing should the file be truncated to zero length on open?
|
boolean |
isWrite()
Is the file to opened for writing?
|
OpenOptions |
setAppend(boolean append)
Whether the file should be opened in append mode.
|
OpenOptions |
setCreate(boolean create)
Set whether the file should be created if it does not already exist.
|
OpenOptions |
setCreateNew(boolean createNew)
Set whether the file should be created and fail if it does exist already.
|
OpenOptions |
setDeleteOnClose(boolean deleteOnClose)
Set whether the file should be deleted when it's closed, or the JVM is shutdown.
|
OpenOptions |
setDsync(boolean dsync)
Set whether every write to the file's content will be written synchronously to the underlying hardware.
|
OpenOptions |
setPerms(String perms)
Set the permissions string
|
OpenOptions |
setRead(boolean read)
Set whether the file is to be opened for reading
|
OpenOptions |
setSparse(boolean sparse)
Set whether a hint should be provided that the file to created is sparse
|
OpenOptions |
setSync(boolean sync)
Set whether every write to the file's content and meta-data will be written synchronously to the underlying hardware.
|
OpenOptions |
setTruncateExisting(boolean truncateExisting)
Set whether the file should be truncated to zero length on opening if it exists and is opened for write
|
OpenOptions |
setWrite(boolean write)
Set whether the file is to be opened for writing
|
public static final String DEFAULT_PERMS
public static final boolean DEFAULT_READ
public static final boolean DEFAULT_WRITE
public static final boolean DEFAULT_CREATE
public static final boolean DEFAULT_CREATENEW
public static final boolean DEFAULT_DSYNC
public static final boolean DEFAULT_SYNC
public static final boolean DEFAULT_DELETEONCLOSE
public static final boolean DEFAULT_TRUNCATEEXISTING
public static final boolean DEFAULT_SPARSE
public static final boolean DEFAULT_APPEND
public OpenOptions()
public OpenOptions(OpenOptions other)
other
- the options to copypublic OpenOptions(JsonObject json)
json
- the JSONpublic String getPerms()
public OpenOptions setPerms(String perms)
perms
- the permissions stringpublic boolean isRead()
public OpenOptions setRead(boolean read)
read
- true if the file is to be opened for readingpublic boolean isWrite()
public OpenOptions setWrite(boolean write)
write
- true if the file is to be opened for writingpublic boolean isCreate()
public OpenOptions setCreate(boolean create)
create
- true if the file should be created if it does not already existpublic boolean isCreateNew()
public OpenOptions setCreateNew(boolean createNew)
createNew
- true if the file should be created or fail if it exists alreadypublic boolean isDeleteOnClose()
public OpenOptions setDeleteOnClose(boolean deleteOnClose)
deleteOnClose
- whether the file should be deleted when it's closed, or the JVM is shutdown.public boolean isTruncateExisting()
public OpenOptions setTruncateExisting(boolean truncateExisting)
truncateExisting
- true if the file should be truncated to zero length on opening if it exists and is opened for writepublic boolean isSparse()
public OpenOptions setSparse(boolean sparse)
sparse
- true if a hint should be provided that the file to created is sparsepublic boolean isSync()
public OpenOptions setSync(boolean sync)
sync
- true if syncpublic boolean isDsync()
public OpenOptions setDsync(boolean dsync)
dsync
- true if syncpublic boolean isAppend()
public OpenOptions setAppend(boolean append)
false
.append
- true to open file in append mode, false otherwiseCopyright © 2021 Eclipse. All rights reserved.