List of usage examples for com.amazonaws ClientConfiguration withUserAgentPrefix
public ClientConfiguration withUserAgentPrefix(String prefix)
From source file:io.confluent.connect.s3.storage.S3Storage.java
License:Open Source License
/** * Creates S3 client's configuration.//from w ww. j a v a 2 s. c om * This method currently configures the AWS client retry policy to use full jitter. * Visible for testing. * * @param config the S3 configuration. * @return S3 client's configuration */ public ClientConfiguration newClientConfiguration(S3SinkConnectorConfig config) { String version = String.format(VERSION_FORMAT, Version.getVersion()); ClientConfiguration clientConfiguration = PredefinedClientConfigurations.defaultConfig(); clientConfiguration.withUserAgentPrefix(version).withRetryPolicy(newFullJitterRetryPolicy(config)); if (StringUtils.isNotBlank(config.getString(S3_PROXY_URL_CONFIG))) { S3ProxyConfig proxyConfig = new S3ProxyConfig(config); clientConfiguration.withProtocol(proxyConfig.protocol()).withProxyHost(proxyConfig.host()) .withProxyPort(proxyConfig.port()).withProxyUsername(proxyConfig.user()) .withProxyPassword(proxyConfig.pass()); } clientConfiguration.withUseExpectContinue(config.useExpectContinue()); return clientConfiguration; }