Top Description Fields Constructors Methods
io.vertx.core.file

public Class OpenOptions

extends Object
Class Inheritance
Annotations
@DataObject
@JsonGen
publicConverter:false
Imports
io.vertx.codegen.annotations.DataObject, io.vertx.codegen.json.annotations.JsonGen, io.vertx.core.json.JsonObject

Describes how an io.vertx.core.file.AsyncFile should be opened.
Author
Tim Fox

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private boolean
public static final boolean
DEFAULT_APPEND

Whether the file should be opened in append mode by default = false.

public static final boolean
public static final boolean
public static final boolean
public static final boolean
public static final String
public static final boolean
public static final boolean
public static final boolean
public static final boolean
public static final boolean
private boolean
private boolean
private String
private boolean
private boolean
private boolean
private boolean
private boolean

Constructor Summary

AccessConstructor and Description
public
OpenOptions()

Default constructor

public
OpenOptions(OpenOptions
the options to copy
other
)

Copy constructor

public
OpenOptions(JsonObject
the JSON
json
)
References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

Constructor to create options from JSON

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the permissions string
getPerms
()

Get the permissions string to be used if creating a file

public boolean

Returns:

true if the file should be opened in append mode, false otherwise
isAppend
()

public boolean

Returns:

true if the file should be created if it does not already exist
isCreate
()

Should the file be created if it does not already exist?

public boolean

Returns:

true if the file should be created if and the open fail if it already exists.
isCreateNew
()

Should the file be created if and the open fail if it already exists?

public boolean

Returns:

true if the file should be deleted when it's closed or the JVM shutdown
isDeleteOnClose
()

Should the file be deleted when it's closed, or the JVM is shutdown.

public boolean

Returns:

true if sync
isDsync
()

If true then every write to the file's content will be written synchronously to the underlying hardware.

public boolean

Returns:

true if to be opened for reading
isRead
()

Is the file to opened for reading?

public boolean

Returns:

true if a hint should be provided that the file to created is sparse
isSparse
()

Set whether a hint should be provided that the file to created is sparse

public boolean

Returns:

true if sync
isSync
()

If true then every write to the file's content and metadata will be written synchronously to the underlying hardware.

public boolean

Returns:

true if the file exists and is opened for writing and the file be truncated to zero length on open
isTruncateExisting
()

If the file exists and is opened for writing should the file be truncated to zero length on open?

public boolean

Returns:

true if to be opened for writing
isWrite
()

Is the file to opened for writing?

public OpenOptions

Returns:

a reference to this, so the API can be used fluently
setAppend
(boolean
true to open file in append mode, false otherwise
append
)

Whether the file should be opened in append mode.

public OpenOptions

Returns:

a reference to this, so the API can be used fluently
setCreate
(boolean
true if the file should be created if it does not already exist
create
)

Set whether the file should be created if it does not already exist.

public OpenOptions

Returns:

a reference to this, so the API can be used fluently
setCreateNew
(boolean
true if the file should be created or fail if it exists already
createNew
)

Set whether the file should be created and fail if it does exist already.

public OpenOptions

Returns:

a reference to this, so the API can be used fluently
setDeleteOnClose
(boolean
whether the file should be deleted when it's closed, or the JVM is shutdown.
deleteOnClose
)

Set whether the file should be deleted when it's closed, or the JVM is shutdown.

public OpenOptions

Returns:

a reference to this, so the API can be used fluently
setDsync
(boolean
true if sync
dsync
)

Set whether every write to the file's content will be written synchronously to the underlying hardware.

public OpenOptions

Returns:

a reference to this, so the API can be used fluently
setPerms
(String
the permissions string
perms
)

Set the permissions string

public OpenOptions

Returns:

a reference to this, so the API can be used fluently
setRead
(boolean
true if the file is to be opened for reading
read
)

Set whether the file is to be opened for reading

public OpenOptions

Returns:

a reference to this, so the API can be used fluently
setSparse
(boolean
true if a hint should be provided that the file to created is sparse
sparse
)

Set whether a hint should be provided that the file to created is sparse

public OpenOptions

Returns:

a reference to this, so the API can be used fluently
setSync
(boolean
true if sync
sync
)

Set whether every write to the file's content and meta-data will be written synchronously to the underlying hardware.

public OpenOptions

Returns:

a reference to this, so the API can be used fluently
setTruncateExisting
(boolean
true if the file should be truncated to zero length on opening if it exists and is opened for write
truncateExisting
)

Set whether the file should be truncated to zero length on opening if it exists and is opened for write

public OpenOptions

Returns:

a reference to this, so the API can be used fluently
setWrite
(boolean
true if the file is to be opened for writing
write
)

Set whether the file is to be opened for writing

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

appendback to summary
private boolean append
createback to summary
private boolean create
createNewback to summary
private boolean createNew
DEFAULT_APPENDback to summary
public static final boolean DEFAULT_APPEND

Whether the file should be opened in append mode by default = false.

DEFAULT_CREATEback to summary
public static final boolean DEFAULT_CREATE
DEFAULT_CREATENEWback to summary
public static final boolean DEFAULT_CREATENEW
DEFAULT_DELETEONCLOSEback to summary
public static final boolean DEFAULT_DELETEONCLOSE
DEFAULT_DSYNCback to summary
public static final boolean DEFAULT_DSYNC
DEFAULT_PERMSback to summary
public static final String DEFAULT_PERMS
DEFAULT_READback to summary
public static final boolean DEFAULT_READ
DEFAULT_SPARSEback to summary
public static final boolean DEFAULT_SPARSE
DEFAULT_SYNCback to summary
public static final boolean DEFAULT_SYNC
DEFAULT_TRUNCATEEXISTINGback to summary
public static final boolean DEFAULT_TRUNCATEEXISTING
DEFAULT_WRITEback to summary
public static final boolean DEFAULT_WRITE
deleteOnCloseback to summary
private boolean deleteOnClose
dsyncback to summary
private boolean dsync
permsback to summary
private String perms
readback to summary
private boolean read
sparseback to summary
private boolean sparse
syncback to summary
private boolean sync
truncateExistingback to summary
private boolean truncateExisting
writeback to summary
private boolean write

Constructor Detail

OpenOptionsback to summary
public OpenOptions()

Default constructor

OpenOptionsback to summary
public OpenOptions(OpenOptions other)

Copy constructor

Parameters
other:OpenOptions

the options to copy

OpenOptionsback to summary
public OpenOptions(JsonObject json)

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Constructor to create options from JSON

Parameters
json:JsonObject

the JSON

Method Detail

getPermsback to summary
public String getPerms()

Get the permissions string to be used if creating a file

Returns:String

the permissions string

isAppendback to summary
public boolean isAppend()
Returns:boolean

true if the file should be opened in append mode, false otherwise

isCreateback to summary
public boolean isCreate()

Should the file be created if it does not already exist?

Returns:boolean

true if the file should be created if it does not already exist

isCreateNewback to summary
public boolean isCreateNew()

Should the file be created if and the open fail if it already exists?

Returns:boolean

true if the file should be created if and the open fail if it already exists.

isDeleteOnCloseback to summary
public boolean isDeleteOnClose()

Should the file be deleted when it's closed, or the JVM is shutdown.

Returns:boolean

true if the file should be deleted when it's closed or the JVM shutdown

isDsyncback to summary
public boolean isDsync()

If true then every write to the file's content will be written synchronously to the underlying hardware.

Returns:boolean

true if sync

isReadback to summary
public boolean isRead()

Is the file to opened for reading?

Returns:boolean

true if to be opened for reading

isSparseback to summary
public boolean isSparse()

Set whether a hint should be provided that the file to created is sparse

Returns:boolean

true if a hint should be provided that the file to created is sparse

isSyncback to summary
public boolean isSync()

If true then every write to the file's content and metadata will be written synchronously to the underlying hardware.

Returns:boolean

true if sync

isTruncateExistingback to summary
public boolean isTruncateExisting()

If the file exists and is opened for writing should the file be truncated to zero length on open?

Returns:boolean

true if the file exists and is opened for writing and the file be truncated to zero length on open

isWriteback to summary
public boolean isWrite()

Is the file to opened for writing?

Returns:boolean

true if to be opened for writing

setAppendback to summary
public OpenOptions setAppend(boolean append)

Whether the file should be opened in append mode. Defaults to false.

Parameters
append:boolean

true to open file in append mode, false otherwise

Returns:OpenOptions

a reference to this, so the API can be used fluently

setCreateback to summary
public OpenOptions setCreate(boolean create)

Set whether the file should be created if it does not already exist.

Parameters
create:boolean

true if the file should be created if it does not already exist

Returns:OpenOptions

a reference to this, so the API can be used fluently

setCreateNewback to summary
public OpenOptions setCreateNew(boolean createNew)

Set whether the file should be created and fail if it does exist already.

Parameters
createNew:boolean

true if the file should be created or fail if it exists already

Returns:OpenOptions

a reference to this, so the API can be used fluently

setDeleteOnCloseback to summary
public OpenOptions setDeleteOnClose(boolean deleteOnClose)

Set whether the file should be deleted when it's closed, or the JVM is shutdown.

Parameters
deleteOnClose:boolean

whether the file should be deleted when it's closed, or the JVM is shutdown.

Returns:OpenOptions

a reference to this, so the API can be used fluently

setDsyncback to summary
public OpenOptions setDsync(boolean dsync)

Set whether every write to the file's content will be written synchronously to the underlying hardware.

Parameters
dsync:boolean

true if sync

Returns:OpenOptions

a reference to this, so the API can be used fluently

setPermsback to summary
public OpenOptions setPerms(String perms)

Set the permissions string

Parameters
perms:String

the permissions string

Returns:OpenOptions

a reference to this, so the API can be used fluently

setReadback to summary
public OpenOptions setRead(boolean read)

Set whether the file is to be opened for reading

Parameters
read:boolean

true if the file is to be opened for reading

Returns:OpenOptions

a reference to this, so the API can be used fluently

setSparseback to summary
public OpenOptions setSparse(boolean sparse)

Set whether a hint should be provided that the file to created is sparse

Parameters
sparse:boolean

true if a hint should be provided that the file to created is sparse

Returns:OpenOptions

a reference to this, so the API can be used fluently

setSyncback to summary
public OpenOptions setSync(boolean sync)

Set whether every write to the file's content and meta-data will be written synchronously to the underlying hardware.

Parameters
sync:boolean

true if sync

Returns:OpenOptions

a reference to this, so the API can be used fluently

setTruncateExistingback to summary
public OpenOptions setTruncateExisting(boolean truncateExisting)

Set whether the file should be truncated to zero length on opening if it exists and is opened for write

Parameters
truncateExisting:boolean

true if the file should be truncated to zero length on opening if it exists and is opened for write

Returns:OpenOptions

a reference to this, so the API can be used fluently

setWriteback to summary
public OpenOptions setWrite(boolean write)

Set whether the file is to be opened for writing

Parameters
write:boolean

true if the file is to be opened for writing

Returns:OpenOptions

a reference to this, so the API can be used fluently