java.lang.Object
org.tentackle.update.ClientUpdateUtilities
Utility methods to implement the application update.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDetermines the installation type of the running application.Determines the jpackage's root installation directory.downloadZip(UpdateInfo updateInfo, File updateDir, Consumer<Double> progressConsumer) Downloads the zip-file.static ClientUpdateUtilitiesThe singleton.Gets the message digest to create the checksum of the downloaded zip file.getUpdateService(String serviceName, RMIClientSocketFactory csf) Gets the remote update service object.booleanChecks whether given directory an updatable jlink image.booleanChecks whetherbooleanChecks whether the application is running in an updatable jlink directory.
-
Constructor Details
-
ClientUpdateUtilities
public ClientUpdateUtilities()Creates a client update utilities instance.
-
-
Method Details
-
getInstance
The singleton.- Returns:
- the singleton
-
isUpdatableJlinkDirectory
Checks whether given directory an updatable jlink image.- Parameters:
dir- the directory to check- Returns:
- true if updatable jlink structure found
-
isUpdateableJlinkApplication
public boolean isUpdateableJlinkApplication()Checks whether the application is running in an updatable jlink directory.- Returns:
- true if current working directory contains an updatable jlink image
-
isUpdatableJPackageApplication
public boolean isUpdatableJPackageApplication()Checks whether- Returns:
- true if jlink structure and updatable
-
determineJPackageRoot
Determines the jpackage's root installation directory.- Returns:
- the installation directory, null if not a jpackage installation
-
determineInstallationType
Determines the installation type of the running application.- Returns:
- the installation type, null if not an updatable installation
-
getUpdateService
Gets the remote update service object.- Parameters:
serviceName- the service name, for ex."rmi://localhost/Update:33002"csf- the optional socket factory, null if default- Returns:
- the update service
-
getMessageDigest
Gets the message digest to create the checksum of the downloaded zip file.- Returns:
- the message digest
- Throws:
NoSuchAlgorithmException- if no such digest
-
downloadZip
Downloads the zip-file.- Parameters:
updateInfo- the update infoupdateDir- the directory to create for the update processprogressConsumer- the consumer receiving the progress from 0.0 to 1.0, null if none- Returns:
- the downloaded ZIP file in the created update directory
-