Class VersionUtils

java.lang.Object
com.ultikits.ultitools.utils.VersionUtils

public class VersionUtils extends Object
Utility class for version checking and comparison operations. Provides methods to check for plugin updates and compare semantic versions.
Since:
6.0.0
Author:
wisdomme
See Also:
  • Constructor Details

    • VersionUtils

      public VersionUtils()
  • Method Details

    • getUltiToolsNewestVersion

      public static String getUltiToolsNewestVersion()
      Get the newest version of UltiTools from the remote API.

      Returns null when the catalogue answers with an error status, an error envelope, no data, or a body that cannot be read, and when it cannot be reached; this contract is unchanged as of 6.3.0. The start-up update check uses lookUpUltiToolsNewestVersion() instead, which tells those failures apart from a version.

      Returns:
      the newest UltiTools version string, or null
    • lookUpUltiToolsNewestVersion

      @Internal public static VersionLookup lookUpUltiToolsNewestVersion()
      Looks up the newest UltiTools version and says whether the lookup established anything (Phase 19, D19-032). VersionLookup.Outcome.FOUND carries the version exactly as getUltiToolsNewestVersion() returns it; every case that method answers with null is VersionLookup.Outcome.FAILED here, because the catalogue always names a newest version when it answers normally.

      An exception thrown while asking (for example a class that can no longer be loaded while the plugin is disabling) propagates, exactly as it does from getUltiToolsNewestVersion().

      Returns:
      the lookup's outcome, never null
      Since:
      6.3.0
    • readNewestVersion

      private static String readNewestVersion(String body)