use of com.talend.shaded.org.apache.hadoop.fs.s3a.AnonymousAWSCredentialsProvider in project components by Talend.
the class S3Connection method createClient.
public static AmazonS3 createClient(S3DatastoreProperties properties) {
AWSCredentialsProviderChain credentials;
if (properties.specifyCredentials.getValue()) {
credentials = new AWSCredentialsProviderChain(new BasicAWSCredentialsProvider(properties.accessKey.getValue(), properties.secretKey.getValue()), new DefaultAWSCredentialsProviderChain(), new AnonymousAWSCredentialsProvider());
} else {
// do not be polluted by hidden accessKey/secretKey
credentials = new AWSCredentialsProviderChain(new DefaultAWSCredentialsProviderChain(), new AnonymousAWSCredentialsProvider());
}
AmazonS3 conn = new AmazonS3Client(credentials);
return conn;
}
Aggregations