# UpdateDescriptorEntry

Import: `import com.install4j.api.update.UpdateDescriptorEntry;`

```java
interface UpdateDescriptorEntry extends Serializable
```

Contains information about a single media file available for update. Instances of this
class are returned by an [`UpdateDescriptor`](UpdateDescriptor.md).

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getTargetMediaFileId()`](#gettargetmediafileid) | `String` | Returns the media file ID for which this update is suitable. |
| [`getUpdatableVersionMin()`](#getupdatableversionmin) | `String` | Returns the minimum version that is eligible for an update. |
| [`getUpdatableVersionMax()`](#getupdatableversionmax) | `String` | Returns the maximum version that is eligible for an update. |
| [`getFileName()`](#getfilename) | `String` | Returns the file name of the update installer. |
| [`getURL()`](#geturl) | `URL` | Returns the full URL from which the update installer can be downloaded. |
| [`getNewVersion()`](#getnewversion) | `String` | Returns the version of the available update. |
| [`getNewMediaFileId()`](#getnewmediafileid) | `String` | Returns the media file ID of the update installer that is represented by this entry. |
| [`isArchive()`](#isarchive) | `boolean` | Returns whether the media file is an installer or an archive. |
| [`isSingleBundle()`](#issinglebundle) | `boolean` | Returns whether the media file is a macOS single bundle archive. |
| [`getFileSize()`](#getfilesize) | `long` | Returns the file size of the update installer in bytes. |
| [`getSha256Sum()`](#getsha256sum) | `String` | Returns the SHA-256 sum of the file if the option to calculate checksums has been enabled. |
| [`getMd5Sum()`](#getmd5sum) | `String` | Returns the MD5 sum of the file if the option to calculate checksums has been enabled. |
| [`getFileSizeVerbose()`](#getfilesizeverbose) | `String` | Returns the file size of the update installer as a verbose string. |
| [`getBundledJre()`](#getbundledjre) | `String` | Returns the file name of the bundled JRE. |
| [`getJreMinVersion()`](#getjreminversion) | `String` | Returns the required minimum version of the JRE. |
| [`getJreMaxVersion()`](#getjremaxversion) | `String` | Returns the required maximum version of the JRE. |
| [`getComment()`](#getcomment) | `String` | Returns the comment for this entry. |
| [`getAdditionalAttribute(String, String)`](#getadditionalattribute-string-string) | `String` | Returns an additional attribute that you have added to the `entry` element in the `updates.xml` file represented by this instance. |
| [`checkVersionCompatible(String)`](#checkversioncompatible-string) | `boolean` | Checks if a version is compatible with the minimum and maximum updatable versions and lower than the new version of this update descriptor entry. |
| [`isDownloaded()`](#isdownloaded) | `boolean` | Checks if an updater with this version is already downloaded and scheduled for installation by a "Schedule update installation" action. |

### getTargetMediaFileId()

```java
String getTargetMediaFileId()
```

Returns the media file ID for which this update is suitable.

Note: install4j creates one update descriptor entry for
each media file. If you discontinue a media file, you can duplicate a suitable update descriptor entry in
`updates.xml` and set its target media file ID to that of the discontinued media file.


**Returns:** the media file ID

### getUpdatableVersionMin()

```java
String getUpdatableVersionMin()
```

Returns the minimum version that is eligible for an update.

By default, this is the empty string. If you want to set a minimum version, you can
change the `updatableVersionMin` attribute on the corresponding `entry` element
in the `updates.xml` file.


**Returns:** the minimum version

### getUpdatableVersionMax()

```java
String getUpdatableVersionMax()
```

Returns the maximum version that is eligible for an update.

By default, this is the empty string. If you want to set a maximum version, you can
change the `updatableVersionMax` attribute on the corresponding `entry` element
in the `updates.xml` file.


**Returns:** the maximum version

### getFileName()

```java
String getFileName()
```

Returns the file name of the update installer.


**Returns:** the file name

### getURL()

```java
URL getURL()
```

Returns the full URL from which the update installer can be downloaded.
This includes the file name and is based on the [`base url`](UpdateDescriptor.md#getbaseurl)
of the [`update descriptor`](UpdateDescriptor.md).


**Returns:** the URL

### getNewVersion()

```java
String getNewVersion()
```

Returns the version of the available update.


**Returns:** the new version

### getNewMediaFileId()

```java
String getNewMediaFileId()
```

Returns the media file ID of the update installer that is represented by this entry.


**Returns:** the media file ID

### isArchive()

```java
boolean isArchive()
```

Returns whether the media file is an installer or an archive.


**Returns:** `true` for an archive

### isSingleBundle()

```java
boolean isSingleBundle()
```

Returns whether the media file is a macOS single bundle archive.


**Returns:** `true` for a single bundle archive

### getFileSize()

```java
long getFileSize()
```

Returns the file size of the update installer in bytes. The size is determined at compile time.


**Returns:** the file size in bytes

### getSha256Sum()

```java
String getSha256Sum()
```

Returns the SHA-256 sum of the file if the option to calculate checksums has been enabled. That option is
found on the General Settings->Media File Options step in the install4j IDE. If the option is disabled,
this method returns null.


**Returns:** the SHA-256 sum as a hex string or null if checksums are not calculated

### getMd5Sum()

```java
String getMd5Sum()
```

Returns the MD5 sum of the file if the option to calculate checksums has been enabled. That option is
found on the General Settings->Media File Options step in the install4j IDE. If the option is disabled,
this method returns null.


**Returns:** the MD5 sum as a hex string or null if checksums are not calculated

### getFileSizeVerbose()

```java
String getFileSizeVerbose()
```

Returns the file size of the update installer as a verbose string. The size is determined at compile time.


**Returns:** the file size as a string

### getBundledJre()

```java
String getBundledJre()
```

Returns the file name of the bundled JRE. If no JRE is bundled, this is the empty string.


**Returns:** the file name of the bundled JRE or the empty string

### getJreMinVersion()

```java
String getJreMinVersion()
```

Returns the required minimum version of the JRE.


**Returns:** the minimum version or the empty string

### getJreMaxVersion()

```java
String getJreMaxVersion()
```

Returns the required maximum version of the JRE.


**Returns:** the maximum version or the empty string

### getComment()

```java
String getComment()
```

Returns the comment for this entry. By default, the comment is empty. You can add
comments in the `comment` elements in the `updates.xml` file. The comment with the language that matches
the current locale is returned. If there is no matching language, the comment for the principal language is returned.

The default standalone update downloader offers the user a hyperlink to display this comment for an available update.


**Returns:** the comment

### getAdditionalAttribute(String, String)

```java
String getAdditionalAttribute(String attributeName, String defaultValue)
```

Returns an additional attribute that you have added to the `entry` element in the `updates.xml` file
represented by this instance.


**Parameters:**

- `attributeName` — the name of the additional attribute
- `defaultValue` — the default value to be returned if the attribute does not exist

**Returns:** the attribute value

### checkVersionCompatible(String)

```java
boolean checkVersionCompatible(String version)
```

Checks if a version is compatible with the minimum and maximum updatable versions and lower than the new version
of this update descriptor entry. In that case, this update descriptor entry is a candidate for downloading an
update when only considering version numbers.


**Parameters:**

- `version` — the version

**Returns:** `true` if compatible

### isDownloaded()

```java
boolean isDownloaded()
```

Checks if an updater with this version is already downloaded and scheduled for installation by a "Schedule update installation" action.


**Returns:** `true` if scheduled

