Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
waziqi89 committed Mar 6, 2024
1 parent 543feb2 commit 5dcc375
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/main/java/com/yelp/nrtsearch/server/module/S3Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@

import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.AnonymousAWSCredentials;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
import com.amazonaws.auth.profile.ProfilesConfigFile;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration;
import com.amazonaws.retry.PredefinedRetryPolicies;
import com.amazonaws.retry.RetryPolicy;
Expand Down Expand Up @@ -51,14 +48,14 @@ protected AmazonS3 providesAmazonS3(LuceneServerConfiguration luceneServerConfig
} else {
Path botoCfgPath = Paths.get(luceneServerConfiguration.getBotoCfgPath());
final ProfilesConfigFile profilesConfigFile = new ProfilesConfigFile(botoCfgPath.toFile());
awsCredentialsProvider =
new ProfileCredentialsProvider(profilesConfigFile, "default");
awsCredentialsProvider = new ProfileCredentialsProvider(profilesConfigFile, "default");
}
final boolean globalBucketAccess = luceneServerConfiguration.getEnableGlobalBucketAccess();
AmazonS3 s3ClientInterim = AmazonS3ClientBuilder.standard()
.withCredentials(awsCredentialsProvider)
.withForceGlobalBucketAccessEnabled(globalBucketAccess)
.build();
AmazonS3 s3ClientInterim =
AmazonS3ClientBuilder.standard()
.withCredentials(awsCredentialsProvider)
.withForceGlobalBucketAccessEnabled(globalBucketAccess)
.build();
String region = s3ClientInterim.getBucketLocation(luceneServerConfiguration.getBucketName());
// In useast-1, the region is returned as "US" which is an equivalent to "us-east-1"
// https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/model/Region.html#US_Standard
Expand Down

0 comments on commit 5dcc375

Please sign in to comment.