## install4j API documentation

## com.install4j.api.context
Class OverwriteMode

    java.lang.Object
      com.install4j.api.context.OverwriteMode

    public class OverwriteMode

extends java.lang.Object

Enumeration class that represents the different ways how install4j can react if asked to install a file over an already existing file.

Author:
  ej-technologies GmbH
See Also:
  `FileOptions`

Field Summary
`static OverwriteMode` | `ALWAYS` Indicates that if the destination file exists it will be replaced in any case.
`static 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.
`static 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.
`static OverwriteMode` | `IF_NEWER` Indicates that if the destination file exists it will be replaced if the source file is newer.
`static OverwriteMode` | `IF_NEWER_OTHERWISE_ASK` Indicates that if the destination file exists it will be replaced if the source file is newer.
`static OverwriteMode` | `NEVER` Indicates that if the destination file exists it won't be replaced in any case.

Method Summary
`static OverwriteMode` | `getFromIntValue(int overwrite)` Convert int value to constant.
`int` | `getIntValue()` Convert to an int value.
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field 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

### getIntValue

    public int getIntValue()

  Convert to an int value.

  Returns:
    the int value

### getFromIntValue

    public static OverwriteMode getFromIntValue(int overwrite)

  Convert int value to constant.

  Parameters:
    `overwrite` - the int value
  Returns:
    the constant

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`