Search in sources :

Example 1 with DefaultAWSCredentialsProviderChain

use of com.talend.shaded.com.amazonaws.auth.DefaultAWSCredentialsProviderChain 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;
}
Also used : DefaultAWSCredentialsProviderChain(com.talend.shaded.com.amazonaws.auth.DefaultAWSCredentialsProviderChain) AmazonS3(com.talend.shaded.com.amazonaws.services.s3.AmazonS3) AmazonS3Client(com.talend.shaded.com.amazonaws.services.s3.AmazonS3Client) AnonymousAWSCredentialsProvider(com.talend.shaded.org.apache.hadoop.fs.s3a.AnonymousAWSCredentialsProvider) BasicAWSCredentialsProvider(com.talend.shaded.org.apache.hadoop.fs.s3a.BasicAWSCredentialsProvider) DefaultAWSCredentialsProviderChain(com.talend.shaded.com.amazonaws.auth.DefaultAWSCredentialsProviderChain) AWSCredentialsProviderChain(com.talend.shaded.com.amazonaws.auth.AWSCredentialsProviderChain)

Aggregations

AWSCredentialsProviderChain (com.talend.shaded.com.amazonaws.auth.AWSCredentialsProviderChain)1 DefaultAWSCredentialsProviderChain (com.talend.shaded.com.amazonaws.auth.DefaultAWSCredentialsProviderChain)1 AmazonS3 (com.talend.shaded.com.amazonaws.services.s3.AmazonS3)1 AmazonS3Client (com.talend.shaded.com.amazonaws.services.s3.AmazonS3Client)1 AnonymousAWSCredentialsProvider (com.talend.shaded.org.apache.hadoop.fs.s3a.AnonymousAWSCredentialsProvider)1 BasicAWSCredentialsProvider (com.talend.shaded.org.apache.hadoop.fs.s3a.BasicAWSCredentialsProvider)1