Class PolarisDownloadUtility
- java.lang.Object
-
- com.blackduck.integration.polaris.common.cli.PolarisDownloadUtility
-
public class PolarisDownloadUtility extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static Integer
DEFAULT_POLARIS_TIMEOUT
static String
LINUX_DOWNLOAD_URL_FORMAT
static String
MAC_ARM_DOWNLOAD_URL_FORMAT
static String
MAC_DOWNLOAD_URL_FORMAT
static String
POLARIS_CLI_INSTALL_DIRECTORY
static String
VERSION_FILENAME
static String
WINDOWS_DOWNLOAD_URL_FORMAT
-
Constructor Summary
Constructors Constructor Description PolarisDownloadUtility(com.blackduck.integration.log.IntLogger logger, com.blackduck.integration.util.OperatingSystemType operatingSystemType, com.blackduck.integration.rest.client.IntHttpClient intHttpClient, com.blackduck.integration.util.CleanupZipExpander cleanupZipExpander, com.blackduck.integration.rest.HttpUrl polarisServerUrl, File downloadTargetDirectory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PolarisDownloadUtility
defaultUtility(com.blackduck.integration.log.IntLogger logger, com.blackduck.integration.rest.HttpUrl polarisServerUrl, com.blackduck.integration.rest.proxy.ProxyInfo proxyInfo, File downloadTargetDirectory)
static PolarisDownloadUtility
defaultUtilityNoProxy(com.blackduck.integration.log.IntLogger logger, com.blackduck.integration.rest.HttpUrl polarisServerUrl, File downloadTargetDirectory)
String
getDownloadUrlFormat()
File
getOrCreateVersionFile()
Optional<File>
getOrDownloadPolarisCliBin()
Optional<File>
getOrDownloadPolarisCliBin(File versionFile, String downloadUrlFormat)
Optional<String>
getOrDownloadPolarisCliExecutable()
The Coverity on Polaris CLI will be downloaded if it has not previously been downloaded or if it has been updated on the server.Optional<String>
getOrDownloadPolarisCliHome()
-
-
-
Field Detail
-
DEFAULT_POLARIS_TIMEOUT
public static final Integer DEFAULT_POLARIS_TIMEOUT
-
LINUX_DOWNLOAD_URL_FORMAT
public static final String LINUX_DOWNLOAD_URL_FORMAT
- See Also:
- Constant Field Values
-
WINDOWS_DOWNLOAD_URL_FORMAT
public static final String WINDOWS_DOWNLOAD_URL_FORMAT
- See Also:
- Constant Field Values
-
MAC_DOWNLOAD_URL_FORMAT
public static final String MAC_DOWNLOAD_URL_FORMAT
- See Also:
- Constant Field Values
-
MAC_ARM_DOWNLOAD_URL_FORMAT
public static final String MAC_ARM_DOWNLOAD_URL_FORMAT
- See Also:
- Constant Field Values
-
POLARIS_CLI_INSTALL_DIRECTORY
public static final String POLARIS_CLI_INSTALL_DIRECTORY
- See Also:
- Constant Field Values
-
VERSION_FILENAME
public static final String VERSION_FILENAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PolarisDownloadUtility
public PolarisDownloadUtility(com.blackduck.integration.log.IntLogger logger, com.blackduck.integration.util.OperatingSystemType operatingSystemType, com.blackduck.integration.rest.client.IntHttpClient intHttpClient, com.blackduck.integration.util.CleanupZipExpander cleanupZipExpander, com.blackduck.integration.rest.HttpUrl polarisServerUrl, File downloadTargetDirectory)
-
-
Method Detail
-
defaultUtility
public static PolarisDownloadUtility defaultUtility(com.blackduck.integration.log.IntLogger logger, com.blackduck.integration.rest.HttpUrl polarisServerUrl, com.blackduck.integration.rest.proxy.ProxyInfo proxyInfo, File downloadTargetDirectory)
-
defaultUtilityNoProxy
public static PolarisDownloadUtility defaultUtilityNoProxy(com.blackduck.integration.log.IntLogger logger, com.blackduck.integration.rest.HttpUrl polarisServerUrl, File downloadTargetDirectory)
-
getOrDownloadPolarisCliExecutable
public Optional<String> getOrDownloadPolarisCliExecutable() throws com.blackduck.integration.exception.IntegrationException
The Coverity on Polaris CLI will be downloaded if it has not previously been downloaded or if it has been updated on the server. The absolute path to the swip_cli executable will be returned if it was downloaded or found successfully, otherwise an Optional.empty will be returned and the log will contain details concerning the failure.- Throws:
com.blackduck.integration.exception.IntegrationException
-
getOrDownloadPolarisCliBin
public Optional<File> getOrDownloadPolarisCliBin() throws com.blackduck.integration.exception.IntegrationException
- Throws:
com.blackduck.integration.exception.IntegrationException
-
getOrDownloadPolarisCliBin
public Optional<File> getOrDownloadPolarisCliBin(File versionFile, String downloadUrlFormat)
-
getOrDownloadPolarisCliHome
public Optional<String> getOrDownloadPolarisCliHome() throws com.blackduck.integration.exception.IntegrationException
- Throws:
com.blackduck.integration.exception.IntegrationException
-
getOrCreateVersionFile
public File getOrCreateVersionFile() throws IOException
- Throws:
IOException
-
getDownloadUrlFormat
public String getDownloadUrlFormat() throws com.blackduck.integration.exception.IntegrationException
- Throws:
com.blackduck.integration.exception.IntegrationException
-
-