use of com.blackducksoftware.integration.hub.rest.CredentialsRestConnection in project hub-fortify-ssc-integration-service by blackducksoftware.
the class RestConnectionHelper method getRestConnection.
/**
* Get the Hub REST connection
*
* @param serverConfig
* @param logLevel
* @return
*/
private static CredentialsRestConnection getRestConnection(final HubServerConfig serverConfig, final LogLevel logLevel) {
CredentialsRestConnection restConnection;
try {
final ProxyInfo proxyInfo = getProxyInfo(serverConfig);
restConnection = new CredentialsRestConnection(new PrintStreamIntLogger(System.out, logLevel), serverConfig.getHubUrl(), serverConfig.getGlobalCredentials().getUsername(), serverConfig.getGlobalCredentials().getDecryptedPassword(), serverConfig.getTimeout(), proxyInfo, new UriCombiner());
} catch (final IllegalArgumentException e) {
e.printStackTrace();
throw new RuntimeException(e);
} catch (final EncryptionException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
return restConnection;
}
Aggregations