Class VersionUtility


  • public class VersionUtility
    extends Object
    • Constructor Detail

      • VersionUtility

        public VersionUtility()
    • Method Detail

      • toCommaString

        public static String toCommaString​(String[] arr)
        Transform a String array into a comma separated String Example ["aaa", "bbb", "ccc"] -> "aaa, bbb, cccc"
        Parameters:
        arr - A String Array
        Returns:
        The comma separated String
      • toCommaString

        public static String toCommaString​(String[] arr,
                                           boolean parenthesys)
      • versionCompareStrictMajorVersion

        public static int versionCompareStrictMajorVersion​(String ver1,
                                                           String ver2)
        Compares 2 versions taking into account just their major versions.
        Returns:
        • -1 in case ver1 is lower than ver2
        • 0 in case ver1 equals ver2
        • 1 in case ver1 is higher than ver2
      • checkRemote

        public static ModuleInstallDetail checkRemote​(VariablesSecureApp vars,
                                                      String[] moduleVersionId,
                                                      String[] moduleVersionToUpdateId,
                                                      OBError obErrors,
                                                      HashMap<String,​String> maturityLevels)
                                               throws Exception
        check the dependencies to install new modules
        Parameters:
        moduleVersionId - In param. An String array with the modules version ids, that we want to install.
        moduleVersionToUpdateId - Out param. Modules that need an update.
        obErrors - Out param. Errors in dependencies. Null if no errors.
        maturityLevels -
        Returns:
        ModuleInstallDetail with modulesToInstall, modulesToUpdate and isValidConfiguration
        Throws:
        Exception
      • checkLocal

        public static boolean checkLocal​(VariablesSecureApp vars,
                                         Module[] modulesToInstall,
                                         Module[] modulesToUpdate,
                                         Module[] modulesToMerge,
                                         OBError obErrors)
                                  throws Exception
        check the dependencies to install new modules locally, without connecting to central repository
        Parameters:
        modulesToInstall - In param. New modules to install, with its dependencies.
        modulesToUpdate - In param. Modules to install, with its dependencies.
        modulesToMerge - In param. Modules to merge.
        obErrors - Out param. Errors in dependencies. Null if no errors.
        Returns:
        true if all dependencies can be resolved without need of download any package from central repository, false in other case.
        Throws:
        Exception