use of software.amazon.awssdk.auth.credentials.AwsCredentials in project ddf by codice.
the class MetacardS3StorageRoute method getS3Client.
private S3Client getS3Client() {
Region region = Region.of(getS3Region());
if (StringUtils.isNotBlank(s3AccessKey)) {
AwsCredentials awsCredentials = AwsBasicCredentials.create(s3AccessKey, s3SecretKey);
AwsCredentialsProvider credentialsProvider = StaticCredentialsProvider.create(awsCredentials);
return S3Client.builder().credentialsProvider(credentialsProvider).endpointOverride(URI.create(s3Endpoint)).region(region).build();
}
return S3Client.builder().endpointOverride(URI.create(s3Endpoint)).region(region).build();
}
Aggregations