Package io.vertx.core.file
Class CopyOptions
- java.lang.Object
-
- io.vertx.core.file.CopyOptions
-
public class CopyOptions extends Object
Describes the copy (and move) options.- Author:
- Thomas Segismont
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_ATOMIC_MOVE
Whether move should be performed as an atomic filesystem operation by default = false.static boolean
DEFAULT_COPY_ATTRIBUTES
Whether the file attributes should be copied by default = false.static boolean
DEFAULT_NOFOLLOW_LINKS
Whether symbolic links should not be followed during copy or move operations by default = false.static boolean
DEFAULT_REPLACE_EXISTING
Whether an existing file, empty directory, or link should be replaced by default = false.
-
Constructor Summary
Constructors Constructor Description CopyOptions()
Default constructor.CopyOptions(CopyOptions other)
Copy constructor.CopyOptions(JsonObject json)
Constructor to create options from JSON.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isAtomicMove()
boolean
isCopyAttributes()
boolean
isNofollowLinks()
boolean
isReplaceExisting()
CopyOptions
setAtomicMove(boolean atomicMove)
Whether move should be performed as an atomic filesystem operation.CopyOptions
setCopyAttributes(boolean copyAttributes)
Whether the file attributes should be copied.CopyOptions
setNofollowLinks(boolean nofollowLinks)
Whether symbolic links should not be followed during copy or move operations.CopyOptions
setReplaceExisting(boolean replaceExisting)
Whether an existing file, empty directory, or link should be replaced.
-
-
-
Field Detail
-
DEFAULT_REPLACE_EXISTING
public static final boolean DEFAULT_REPLACE_EXISTING
Whether an existing file, empty directory, or link should be replaced by default = false.- See Also:
- Constant Field Values
-
DEFAULT_COPY_ATTRIBUTES
public static final boolean DEFAULT_COPY_ATTRIBUTES
Whether the file attributes should be copied by default = false.- See Also:
- Constant Field Values
-
DEFAULT_ATOMIC_MOVE
public static final boolean DEFAULT_ATOMIC_MOVE
Whether move should be performed as an atomic filesystem operation by default = false.- See Also:
- Constant Field Values
-
DEFAULT_NOFOLLOW_LINKS
public static final boolean DEFAULT_NOFOLLOW_LINKS
Whether symbolic links should not be followed during copy or move operations by default = false.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CopyOptions
public CopyOptions()
Default constructor.
-
CopyOptions
public CopyOptions(CopyOptions other)
Copy constructor.- Parameters:
other
- the options to copy
-
CopyOptions
public CopyOptions(JsonObject json)
Constructor to create options from JSON.- Parameters:
json
- the JSON
-
-
Method Detail
-
isReplaceExisting
public boolean isReplaceExisting()
- Returns:
- true if an existing file, empty directory, or link should be replaced, false otherwise
-
setReplaceExisting
public CopyOptions setReplaceExisting(boolean replaceExisting)
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
public CopyOptions setCopyAttributes(boolean copyAttributes)
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
public CopyOptions setAtomicMove(boolean atomicMove)
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
public CopyOptions setNofollowLinks(boolean nofollowLinks)
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
-
-