Class ClientUpdateUtilities


  • @Service(ClientUpdateUtilities.class)
    public class ClientUpdateUtilities
    extends java.lang.Object
    Utility methods to implement the application update.
    • Constructor Detail

      • ClientUpdateUtilities

        public ClientUpdateUtilities()
    • Method Detail

      • isApplicationUpdatable

        public boolean isApplicationUpdatable()
        Checks whether the application is running in an updatable directory.
        Returns:
        true if updatable
      • getUpdateService

        public UpdateService getUpdateService​(java.lang.String serviceName,
                                              java.rmi.server.RMIClientSocketFactory csf)
        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
      • dowloadZip

        public java.io.File dowloadZip​(UpdateInfo updateInfo,
                                       java.io.File updateDir,
                                       java.util.function.Consumer<java.lang.Double> progressConsumer)
        Downloads the zipfile.
        Parameters:
        updateInfo - the update info
        updateDir - the directory to create for the update process
        progressConsumer - the consumer receiving the progress from 0.0 to 1.0, null if none
        Returns:
        the downloaded ZIP file in the created update directory