refactored s3connection
This commit is contained in:
parent
15154a3b59
commit
7d9c151b5b
1 changed files with 1 additions and 2 deletions
|
|
@ -41,11 +41,10 @@ public class S3Connection {
|
|||
private static AmazonS3 getS3Client(String endpoint, int port, String accessKey,
|
||||
String secretKey) {
|
||||
AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
|
||||
String s3Endpoint = endpoint;
|
||||
String region = Region.getRegion(Regions.DEFAULT_REGION).toString();
|
||||
|
||||
return AmazonS3ClientBuilder.standard()
|
||||
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(s3Endpoint, region))
|
||||
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, region))
|
||||
.withCredentials(new AWSStaticCredentialsProvider(credentials))
|
||||
.build();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue