Configure AWS SDK for Java to work with Flexify.IO
AWS SDK for Java 1.x
String accessKey = "FLEXIFY_S3_KEY_ID";
String secretKey = "FLEXIFY_S3_SECRET_KEY";
String endpoint = "https://s3.flexify.io";
AmazonS3 s3 = AmazonS3ClientBuilder.standard()
.withCredentials(new AWSStaticCredentialsProvider(
new BasicAWSCredentials(accessKey, secretKey)))
.withEndpointConfiguration(
new AwsClientBuilder.EndpointConfiguration(endpoint, "us-east-1"))
.build();
AWS SDK for Java 2.x
String accessKey = "FLEXIFY_S3_KEY_ID";
String secretKey = "FLEXIFY_S3_SECRET_KEY";
String endpoint = "https://s3.flexify.io";
S3Client s3 = S3Client.builder()
.credentialsProvider(StaticCredentialsProvider.create(
AwsBasicCredentials.create(accessKey, secretKey)))
.endpointOverride(new URI(endpoint))
.region(Region.of("us-east-1"))
.forcePathStyle(true)
.build();