use of com.blackducksoftware.integration.hub.cli.CLIDownloadUtility in project hub-detect by blackducksoftware.
the class OfflineScanner method installSignatureScannerFromUrl.
private void installSignatureScannerFromUrl(final IntLogger intLogger, final HubScanConfig hubScanConfig, final CIEnvironmentVariables ciEnvironmentVariables) throws DetectUserFriendlyException {
try {
OfflineScanner.logger.info(String.format("Attempting to download the signature scanner from %s", detectConfiguration.getHubSignatureScannerHostUrl()));
final UnauthenticatedRestConnectionBuilder restConnectionBuilder = new UnauthenticatedRestConnectionBuilder();
restConnectionBuilder.setBaseUrl(detectConfiguration.getHubSignatureScannerHostUrl());
restConnectionBuilder.setTimeout(detectConfiguration.getHubTimeout());
restConnectionBuilder.applyProxyInfo(detectConfiguration.getHubProxyInfo());
restConnectionBuilder.setLogger(intLogger);
final RestConnection restConnection = restConnectionBuilder.build();
final CLIDownloadUtility cliDownloadUtility = new CLIDownloadUtility(intLogger, restConnection);
cliDownloadUtility.performInstallation(hubScanConfig.getToolsDir(), ciEnvironmentVariables, detectConfiguration.getHubSignatureScannerHostUrl(), "unknown", "hub-detect");
} catch (final Exception e) {
throw new DetectUserFriendlyException(String.format("There was a problem downloading the signature scanner from %s: %s", detectConfiguration.getHubSignatureScannerHostUrl(), e.getMessage()), e, ExitCodeType.FAILURE_GENERAL_ERROR);
}
}
Aggregations