# ExternalFile

Import: `import com.install4j.api.beans.ExternalFile;`

```java
public class ExternalFile extends File
```

Property type for files from outside the distribution tree to be used in beans.
Properties of type `java.io.File` refer to files in the distribution tree. For these properties, in the install4j GUI
a distribution file chooser will be shown that offers only files configured in the "Files" section
of the install4j GUI.

If you use `ExternalFile` as the property type, the install4j GUI will show a regular file chooser
for the property that lets you select files from arbitrary locations. The selected file will be packaged with the installer
during the compilation phase. The name of the file is changed to a unique name during the compilation.
It will be available in a temporary directory when the installer or uninstaller is started and extracted
to the `.install4j` directory in the installation directory by the "Install files" action.

**Note**:At runtime, you have to call `Context.getExternalFile` to transform the property to
an absolute file.


**See also:**

- [Context.getExternalFile](../context/Context.md#getexternalfile-externalfile-boolean)

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getOriginalName()`](#getoriginalname) | `String` | At runtime, the file name will be generated to avoid naming conflicts. |
| [`equals(Object)`](#equals-object) | `boolean` |  |
| [`exists()`](#exists) | `boolean` |  |

### getOriginalName()

```java
public String getOriginalName()
```

At runtime, the file name will be generated to avoid naming conflicts. This method returns the original
file name.


**Returns:** the file name

### equals(Object)

```java
public boolean equals(Object obj)
```

### exists()

```java
public boolean exists()
```

## Constructors

| Signature | Description |
|---|---|
| [`ExternalFile(String)`](#externalfile-string) | The constructor will be invoked by the framework. |
| [`ExternalFile(String, String)`](#externalfile-string-string) | The constructor will be invoked by the framework. |

### ExternalFile(String)

```java
public ExternalFile(String pathname)
```

The constructor will be invoked by the framework.

### ExternalFile(String, String)

```java
public ExternalFile(String pathname, String originalName)
```

The constructor will be invoked by the framework.

