Enum CopyMode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<CopyMode>

    public enum CopyMode
    extends java.lang.Enum<CopyMode>
    CopyOption is an enumeration containing all possible options for copying a file. Note that the CREATE, REPLACE and IGNORE options are mutually exclusive.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CREATE
      Copy to a new destination file, failing if the file already exists.
      IGNORE
      Skip the copy if the destination file if it already exists.
      REPLACE
      If the source and destination are a regular file, the destination file will be replaced.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static CopyMode valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static CopyMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • CREATE

        public static final CopyMode CREATE
        Copy to a new destination file, failing if the file already exists.
      • REPLACE

        public static final CopyMode REPLACE
        If the source and destination are a regular file, the destination file will be replaced. If the destination exists and is not a file and the source is a file, then the destination will be (recursively) deleted before copying. If the source and destination are directories then additional files in the destination directory are not touched.
      • IGNORE

        public static final CopyMode IGNORE
        Skip the copy if the destination file if it already exists.
    • Method Detail

      • values

        public static CopyMode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CopyMode c : CopyMode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CopyMode valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null