# InstallerFileEvent

Import: `import com.install4j.api.events.InstallerFileEvent;`

```java
public class InstallerFileEvent extends InstallerEvent
```

The event object that is passed to installer event listeners for single file installation events types.
Event listeners are registered in the [`InstallerContext`](../context/InstallerContext.md).

This event object contains additional information about the installed file.
The event types [`EventType.BEFORE_INSTALL_FILE`](EventType.md#before-install-file) and [`EventType.AFTER_INSTALL_FILE`](EventType.md#after-install-file)
produce this event object when fired.


**See also:**

- [InstallerEventListener](InstallerEventListener.md)
- [InstallerContext.addInstallerEventListener](../context/InstallerContext.md#addinstallereventlistener-installereventlistener)

## Inherited from

- [InstallerEvent](InstallerEvent.md) — 6 methods

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getDestinationFile()`](#getdestinationfile) | `File` | Get the installed file location associated with this event. |
| [`getFileSize()`](#getfilesize) | `long` | Get the size of the installed file in bytes. |
| [`toString()`](#tostring) | `String` |  |
| [`getVerbose()`](#getverbose) | `String` |  |

### getDestinationFile()

```java
public File getDestinationFile()
```

Get the installed file location associated with this event.


**Returns:** the file

### getFileSize()

```java
public long getFileSize()
```

Get the size of the installed file in bytes.


**Returns:** the size in bytes

### toString()

```java
public String toString()
```

### getVerbose()

```java
public String getVerbose()
```

## Constructors

| Signature | Description |
|---|---|
| [`InstallerFileEvent(Object, Context, EventType, boolean, File, long)`](#installerfileevent-object-context-eventtype-boolean-file-long) | The constructor is called by the framework. |
| [`InstallerFileEvent(Object, Context, EventType, File, long)`](#installerfileevent-object-context-eventtype-file-long) | The constructor is called by the framework. |

### InstallerFileEvent(Object, Context, EventType, boolean, File, long)

```java
public InstallerFileEvent(Object source, Context context, EventType type, boolean success, File destinationFile, long fileSize)
```

The constructor is called by the framework.


**Parameters:**

- `source` — the event source
- `context` — the context
- `type` — the event type.
- `success` — whether the operation associated with the event was successful
- `destinationFile` — the installed file
- `fileSize` — the size of the installed file

### InstallerFileEvent(Object, Context, EventType, File, long)

```java
public InstallerFileEvent(Object source, Context context, EventType type, File destinationFile, long fileSize)
```

The constructor is called by the framework.


**Parameters:**

- `source` — the event source
- `context` — the context
- `type` — the event type.
- `destinationFile` — the installed file
- `fileSize` — the size of the installed file

