Class CopyOptions


  • public class CopyOptions
    extends Object
    Describes the copy (and move) options.
    Author:
    Thomas Segismont
    • 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 to false.
        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 to false.
        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 to false.
        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 to false.
        Parameters:
        nofollowLinks - true to not follow links, false otherwise. Defaults to false.
        Returns:
        a reference to this, so the API can be used fluently