Skip to content

Instantly share code, notes, and snippets.

@sumew
Created September 23, 2016 13:55
Show Gist options
  • Save sumew/a9a3ea79a9d7edc97fe5f2528ec8611a to your computer and use it in GitHub Desktop.
Save sumew/a9a3ea79a9d7edc97fe5f2528ec8611a to your computer and use it in GitHub Desktop.
private ClientConfiguration getClientConfigueration() {
Assert.notNull(proxy, "Proxy address not found!");
return Try.of(() -> new URI(proxy))
.map(uri -> new ClientConfiguration()
.withProxyHost(uri.getHost())
.withProxyPort(uri.getPort())).getOrElseThrow(throwable ->
new S3StorageException("Unable to create client, proxy not available", throwable));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment