Class CopyOptions
java.lang.Object
io.vertx.core.file.CopyOptions
Describes the copy (and move) options.
- Author:
- Thomas Segismont
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanWhether move should be performed as an atomic filesystem operation by default = false.static final booleanWhether the file attributes should be copied by default = false.static final booleanWhether symbolic links should not be followed during copy or move operations by default = false.static final booleanWhether an existing file, empty directory, or link should be replaced by default = false. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.CopyOptions(CopyOptions other) Copy constructor.CopyOptions(JsonObject json) Constructor to create options from JSON. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbooleanbooleansetAtomicMove(boolean atomicMove) Whether move should be performed as an atomic filesystem operation.setCopyAttributes(boolean copyAttributes) Whether the file attributes should be copied.setNofollowLinks(boolean nofollowLinks) Whether symbolic links should not be followed during copy or move operations.setReplaceExisting(boolean replaceExisting) Whether an existing file, empty directory, or link should be replaced.
-
Field Details
-
DEFAULT_REPLACE_EXISTING
public static final boolean DEFAULT_REPLACE_EXISTINGWhether an existing file, empty directory, or link should be replaced by default = false.- See Also:
-
DEFAULT_COPY_ATTRIBUTES
public static final boolean DEFAULT_COPY_ATTRIBUTESWhether the file attributes should be copied by default = false.- See Also:
-
DEFAULT_ATOMIC_MOVE
public static final boolean DEFAULT_ATOMIC_MOVEWhether move should be performed as an atomic filesystem operation by default = false.- See Also:
-
DEFAULT_NOFOLLOW_LINKS
public static final boolean DEFAULT_NOFOLLOW_LINKSWhether symbolic links should not be followed during copy or move operations by default = false.- See Also:
-
-
Constructor Details
-
CopyOptions
public CopyOptions()Default constructor. -
CopyOptions
-
CopyOptions
Constructor to create options from JSON.- Parameters:
json- the JSON
-
-
Method Details
-
isReplaceExisting
public boolean isReplaceExisting()- Returns:
- true if an existing file, empty directory, or link should be replaced, false otherwise
-
setReplaceExisting
Whether an existing file, empty directory, or link should be replaced. Defaults tofalse.- Parameters:
replaceExisting- true to replace, false otherwise- Returns:
- a reference to this, so the API can be used fluently
-
isCopyAttributes
public boolean isCopyAttributes()- Returns:
- true if the file attributes should be copied, false otherwise
-
setCopyAttributes
Whether the file attributes should be copied. Defaults tofalse.- Parameters:
copyAttributes- true to copy attributes, false otherwise- Returns:
- a reference to this, so the API can be used fluently
-
isAtomicMove
public boolean isAtomicMove()- Returns:
- true if move should be performed as an atomic filesystem operation, false otherwise
-
setAtomicMove
Whether move should be performed as an atomic filesystem operation. Defaults tofalse.- Parameters:
atomicMove- true to perform as an atomic filesystem operation, false otherwise- Returns:
- a reference to this, so the API can be used fluently
-
isNofollowLinks
public boolean isNofollowLinks()- Returns:
- true if the operation should not follow links, false otherwise
-
setNofollowLinks
Whether symbolic links should not be followed during copy or move operations. Defaults tofalse.- Parameters:
nofollowLinks- true to not follow links, false otherwise. Defaults tofalse.- Returns:
- a reference to this, so the API can be used fluently
-