Skip to content

Instantly share code, notes, and snippets.

@sumew
Created September 23, 2016 13:55
Show Gist options
  • Save sumew/a31ba39e6f183f8c29e3346c32e8921a to your computer and use it in GitHub Desktop.
Save sumew/a31ba39e6f183f8c29e3346c32e8921a to your computer and use it in GitHub Desktop.
private ClientConfiguration getClientConfigueration() {
Assert.notNull(proxy, "Proxy address not found!");
String host;
int port;
try {
URI uri = new URI(proxy);
host = uri.getHost();
port = uri.getPort();
} catch (URISyntaxException e) {
logger.error("Error creating client", e);
throw new S3StorageException("Unable to create client, proxy not available", e);
}
ClientConfiguration clientConfiguration = new ClientConfiguration()
.withProxyHost(host)
.withProxyPort(port);
return clientConfiguration;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment