aws-support/src/main/java/com/streamsets/pipeline/lib/aws/s3/S3Accessor.java
AmazonS3Client createS3Client() throws StageException {

    AmazonS3ClientBuilder builder = createAmazonS3ClientBuilder().withClientConfiguration(createClientConfiguration())
                                                                 .withChunkedEncodingDisabled(connectionConfigs
                                                                     .isChunkedEncodingEnabled())
                                                                 .withPathStyleAccessEnabled(true);
    AWSCredentialsProvider awsCredentialsProvider = getCredentialsProvider();
    // If we don't call build.withCredentials(...) then we will not overwrite the default credentials provider
    // already set in the builder when doing AmazonS3ClientBuilder.standard() so only calling build.withCredentials(...)
    // if our own provider exists
    if (awsCredentialsProvider != null) {
      builder.withCredentials(awsCredentialsProvider);
    }

    String region = (connectionConfigs.getRegion() == null || connectionConfigs.getRegion().isEmpty())
                    ? null
                    : connectionConfigs.getRegion();

    if (connectionConfigs.isUseEndpoint()) {
      builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(connectionConfigs.getEndpoint(),
          region
      ));
    } else if (region != null) {
      builder.withRegion(connectionConfigs.getRegion());
    } else {
      builder.withRegion(AwsRegion.US_WEST_1.getId());
      builder.withForceGlobalBucketAccessEnabled(true);
    }
    return (AmazonS3Client) builder.build();
  }
AmazonS3Client createS3Client() throws StageException {

    AmazonS3ClientBuilder builder = createAmazonS3ClientBuilder().withClientConfiguration(createClientConfiguration())
                                                                 .withChunkedEncodingDisabled(connectionConfigs
                                                                     .isChunkedEncodingEnabled())
                                                                 .withPathStyleAccessEnabled(true);
    AWSCredentialsProvider awsCredentialsProvider = getCredentialsProvider();
    // If we don't call build.withCredentials(...) then we will not overwrite the default credentials provider
    // already set in the builder when doing AmazonS3ClientBuilder.standard() so only calling build.withCredentials(...)
    // if our own provider exists
    if (awsCredentialsProvider != null) {
      builder.withCredentials(awsCredentialsProvider);
    }

    String region = (connectionConfigs.getRegion() == null || connectionConfigs.getRegion().isEmpty())
                    ? null
                    : connectionConfigs.getRegion();

    if (connectionConfigs.isUseEndpoint()) {
      builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(connectionConfigs.getEndpoint(),
          region
      ));
    } else if (region != null) {
      builder.withRegion(connectionConfigs.getRegion());
    } else {
      builder.withRegion(AwsRegion.US_WEST_1.getId());
      builder.withForceGlobalBucketAccessEnabled(true);
    }
    return (AmazonS3Client) builder.build();
  }
AmazonS3Client createS3Client ( ) throws StageException { AmazonS3ClientBuilder builder = createAmazonS3ClientBuilder ( ) . withClientConfiguration ( createClientConfiguration ( ) ) . withChunkedEncodingDisabled ( connectionConfigs . isChunkedEncodingEnabled ( ) ) . withPathStyleAccessEnabled ( true ) ; AWSCredentialsProvider awsCredentialsProvider = getCredentialsProvider ( ) ; // If we don't call build.withCredentials(...) then we will not overwrite the default credentials provider // already set in the builder when doing AmazonS3ClientBuilder.standard() so only calling build.withCredentials(...) // if our own provider exists if ( awsCredentialsProvider != null ) { builder . withCredentials ( awsCredentialsProvider ) ; } String region = ( connectionConfigs . getRegion ( ) == null || connectionConfigs . getRegion ( ) . isEmpty ( ) ) ? null : connectionConfigs . getRegion ( ) ; if ( connectionConfigs . isUseEndpoint ( ) ) { builder . withEndpointConfiguration ( new AwsClientBuilder . EndpointConfiguration ( connectionConfigs . getEndpoint ( ) , region ) ) ; } else if ( region != null ) { builder . withRegion ( connectionConfigs . getRegion ( ) ) ; } else { builder . withRegion ( AwsRegion . US_WEST_1 . getId ( ) ) ; builder . withForceGlobalBucketAccessEnabled ( true ) ; } return ( AmazonS3Client ) builder . build ( ) ; }
visible for testing
visible for testing