Enum OverwriteMode

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

    public enum OverwriteMode
    extends java.lang.Enum<OverwriteMode>
    Enumeration class that represents the different ways how install4j can react if asked to install a file over an already existing file.
    See Also:
    FileOptions
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ALWAYS
      Indicates that if the destination file exists it will be replaced in any case.
      ALWAYS_ASK
      Indicates that the user will be asked whether to replace the file even if it was installed by a previous run of the installer.
      ALWAYS_ASK_EXCEPT_FOR_UPDATE
      Indicates that if the destination file exists and has not been installed by a previous run of the installer the user will be asked whether to replace the file.
      IF_NEWER
      Indicates that if the destination file exists it will be replaced if the source file is newer.
      IF_NEWER_OTHERWISE_ASK
      Indicates that if the destination file exists it will be replaced if the source file is newer.
      NEVER
      Indicates that if the destination file exists it won't be replaced in any case.
    • Method Summary

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

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

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

      • NEVER

        public static final OverwriteMode NEVER
        Indicates that if the destination file exists it won't be replaced in any case.
      • ALWAYS

        public static final OverwriteMode ALWAYS
        Indicates that if the destination file exists it will be replaced in any case.
      • IF_NEWER

        public static final OverwriteMode IF_NEWER
        Indicates that if the destination file exists it will be replaced if the source file is newer. On Windows, the file version resource will be used for the comparison. If the destination file is newer, it will be skipped silently.
      • IF_NEWER_OTHERWISE_ASK

        public static final OverwriteMode IF_NEWER_OTHERWISE_ASK
        Indicates that if the destination file exists it will be replaced if the source file is newer. On Windows the file version resource will be used for the comparison. If the destination file is newer, the framework will ask the user if the file should be replaced.
      • ALWAYS_ASK_EXCEPT_FOR_UPDATE

        public static final OverwriteMode ALWAYS_ASK_EXCEPT_FOR_UPDATE
        Indicates that if the destination file exists and has not been installed by a previous run of the installer the user will be asked whether to replace the file. Please note that if the user chooses "Never" or "Always", the framework won't ask the user again.
      • ALWAYS_ASK

        public static final OverwriteMode ALWAYS_ASK
        Indicates that the user will be asked whether to replace the file even if it was installed by a previous run of the installer. Please note that if the user chooses "Never" or "Always", the framework won't ask the user again.
    • Method Detail

      • values

        public static OverwriteMode[] 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 (OverwriteMode c : OverwriteMode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static OverwriteMode 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
      • getFromIntValue

        public static OverwriteMode getFromIntValue​(int overwrite)
        Convert int value to constant.
        Parameters:
        overwrite - the int value
        Returns:
        the constant
      • getIntValue

        public int getIntValue()
        Convert to an int value.
        Returns:
        the int value
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<OverwriteMode>