Package com.install4j.api.update
Interface UpdateDescriptorEntry
-
- All Superinterfaces:
java.io.Serializable
public interface UpdateDescriptorEntry extends java.io.Serializable
Contains information about a single media file available for update. Instances of this class are returned by anUpdateDescriptor
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
checkVersionCompatible(java.lang.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.java.lang.String
getAdditionalAttribute(java.lang.String attributeName, java.lang.String defaultValue)
Returns an additional attribute that you have added to theentry
element in theupdates.xml
file represented by this instance.java.lang.String
getBundledJre()
Returns the identifier of the bundled JRE.java.lang.String
getComment()
Returns the comment for this entry.java.lang.String
getFileName()
Returns the file name of the update installer.long
getFileSize()
Returns the file size of the update installer in bytes.java.lang.String
getFileSizeVerbose()
Returns the file size of the update installer as a verbose string.java.lang.String
getMd5Sum()
Returns the MD5 sum of the file if the option to calculate checksums has been enabled.java.lang.String
getNewMediaFileId()
Returns the media file ID of the update installer that is represented by this entry.java.lang.String
getNewVersion()
Returns the version of the available update.java.lang.String
getSha256Sum()
Returns the SHA-256 sum of the file if the option to calculate checksums has been enabled.java.lang.String
getTargetMediaFileId()
Returns the media file ID for which this update is suitable.java.lang.String
getUpdatableVersionMax()
Returns the maximum version that is eligible for an update.java.lang.String
getUpdatableVersionMin()
Returns the minimum version that is eligible for an update.java.net.URL
getURL()
Returns the full URL from which the update installer can be downloaded.boolean
isArchive()
Returns whether the media file is an installer or an archive.boolean
isDownloaded()
Checks if an updater with this version is already downloaded and scheduled for installation by an "Schedule update installation" action.boolean
isSingleBundle()
Returns whether the media file is a macOS single bundle installer or archive.
-
-
-
Method Detail
-
getTargetMediaFileId
java.lang.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.lang.String getUpdatableVersionMin()
Returns the minimum version that is eligible for an update.By default, this is empty string. If you want to set a minimum version, you can change the
updatableVersionMin
attribute on the correspondingentry
element in theupdates.xml
file.- Returns:
- the minimum version
-
getUpdatableVersionMax
java.lang.String getUpdatableVersionMax()
Returns the maximum version that is eligible for an update.By default, this is empty string. If you want to set a maximum version, you can change the
updatableVersionMax
attribute on the correspondingentry
element in theupdates.xml
file.- Returns:
- the maximum version
-
getFileName
java.lang.String getFileName()
Returns the file name of the update installer.- Returns:
- the file name
-
getURL
java.net.URL getURL()
Returns the full URL from which the update installer can be downloaded. This includes the file name and is based on thebase url
of theupdate descriptor
.- Returns:
- the URL
-
getNewVersion
java.lang.String getNewVersion()
Returns the version of the available update.- Returns:
- the new version
-
getNewMediaFileId
java.lang.String getNewMediaFileId()
Returns the media file ID of the update installer that is represented by this entry.- Returns:
- the media file ID
-
isArchive
boolean isArchive()
Returns whether the media file is an installer or an archive.- Returns:
true
for an archive
-
isSingleBundle
boolean isSingleBundle()
Returns whether the media file is a macOS single bundle installer or archive.- Returns:
true
for a single bundle installer or archive
-
getFileSize
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.lang.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.lang.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.lang.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.lang.String getBundledJre()
Returns the identifier of the bundled JRE. If no JRE is bundled, this is the empty string. Otherwise, this is the file name of the JRE bundle without the.tar.gz
extension.- Returns:
- the ID of the bundled JRE or the empty string
-
getComment
java.lang.String getComment()
Returns the comment for this entry. By default, the comment is empty, you can add comments in thecomment
elements in theupdates.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 updater offers the user a hyperlink to display this comment for an available update.
- Returns:
- the comment
-
getAdditionalAttribute
java.lang.String getAdditionalAttribute(java.lang.String attributeName, java.lang.String defaultValue)
Returns an additional attribute that you have added to theentry
element in theupdates.xml
file represented by this instance.- Parameters:
attributeName
- the name of the additional attributedefaultValue
- the default value to be returned if the attribute does not exist- Returns:
- the attribute value
-
checkVersionCompatible
boolean checkVersionCompatible(java.lang.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
boolean isDownloaded()
Checks if an updater with this version is already downloaded and scheduled for installation by an "Schedule update installation" action.- Returns:
true
if scheduled
-
-