# OverwriteMode

Import: `import com.install4j.api.context.OverwriteMode;`

```java
public final 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](FileOptions.md)

## Constants

### NEVER

Indicates that if the destination file exists, it won't be replaced in any case.

### ALWAYS

Indicates that if the destination file exists, it will be replaced in any case.

### 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

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

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

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.

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`values()`](#values) | `OverwriteMode[]` |  |
| [`valueOf(String)`](#valueof-string) | `OverwriteMode` |  |
| [`getFromIntValue(int)`](#getfromintvalue-int) | `OverwriteMode` | Convert int value to constant. |
| [`getIntValue()`](#getintvalue) | `int` | Convert to an int value. |

### values()

```java
public static OverwriteMode[] values()
```

### valueOf(String)

```java
public static OverwriteMode valueOf(String name)
```

### getFromIntValue(int)

```java
public static OverwriteMode getFromIntValue(int overwrite)
```

Convert int value to constant.


**Parameters:**

- `overwrite` — the int value

**Returns:** the constant or `null` if the int value does not correspond to a constant

### getIntValue()

```java
public int getIntValue()
```

Convert to an int value.


**Returns:** the int value

