Class PolarisCliVersionHandler

java.lang.Object
com.blackduck.integration.jenkins.polaris.service.PolarisCliVersionHandler

public class PolarisCliVersionHandler extends Object
  • Constructor Details

    • PolarisCliVersionHandler

      public PolarisCliVersionHandler()
  • Method Details

    • extractPolarisCliVersion

      public String extractPolarisCliVersion(InputStream logStream) throws IOException
      Throws:
      IOException
    • comparePolarisVersions

      public int comparePolarisVersions(String version1, String version2)
      Compares two Polaris CLI version strings in the format "YYYY.MM.P" (e.g., "2024.9.0").
      Parameters:
      version1 - the first version string to compare, in the format "YYYY.MM.P"
      version2 - the second version string to compare, in the format "YYYY.MM.P"
      Returns:
      an integer that is: - Negative if version1 is less than version2 - Zero if version1 is equal to version2 - Positive if version1 is greater than version2 or major part of the version2 is less than length of 4 If either of the versions does not have exactly three components (major, minor, patch), the method returns 1, implying an invalid version format.