Example usage for com.amazonaws ClientConfiguration withUseExpectContinue

List of usage examples for com.amazonaws ClientConfiguration withUseExpectContinue

Introduction

In this page you can find the example usage for com.amazonaws ClientConfiguration withUseExpectContinue.

Prototype

public ClientConfiguration withUseExpectContinue(boolean useExpectContinue) 

Source Link

Document

Sets if use expect continue should be enabled.

Usage

From source file:io.confluent.connect.s3.storage.S3Storage.java

License:Open Source License

/**
 * Creates S3 client's configuration.//from  www  .jav  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;
}