Oleksandr
Oleksandr

Reputation: 3764

How to use aws-java-sdk-s3 with own domain?

I want to change default domain for aws-java-sdk-s3. I need to send objects not on:

http://s3.amazonaws.com/mybucket

but on:

http://my_own_domain.com/mybucket

How to change it?

There is an example:

BasicAWSCredentials awsCreds = new BasicAWSCredentials("my_access", "my_secret");


AmazonS3 s3Client = AmazonS3ClientBuilder.standard()
                .withCredentials(new AWSStaticCredentialsProvider(awsCreds))
                .build();

But it uses domain of amazone.

Upvotes: 1

Views: 1319

Answers (1)

Daniel Scott
Daniel Scott

Reputation: 7951

If you really want to, you can call setEndpoint() on the AmazonS3Client object http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/AmazonS3Client.html#setEndpoint-java.lang.String-

Upvotes: 2

Related Questions