Class PolarisCliVersionHandler
java.lang.Object
com.blackduck.integration.jenkins.polaris.service.PolarisCliVersionHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
comparePolarisVersions
(String version1, String version2) Compares two Polaris CLI version strings in the format "YYYY.MM.P" (e.g., "2024.9.0").extractPolarisCliVersion
(InputStream logStream)
-
Constructor Details
-
PolarisCliVersionHandler
public PolarisCliVersionHandler()
-
-
Method Details
-
extractPolarisCliVersion
- Throws:
IOException
-
comparePolarisVersions
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.
-