Abhishek
Abhishek

Reputation: 71

Difference between AmazonS3 vs S3Client

I am trying to access a pdf stored in s3 bucket . I have bucket name and arn. After going through lot of example I did not understand difference between two services S3Client and AmazonS3 .

AmazonS3 s3Client = AmazonS3ClientBuilder.standard()
                .withRegion(Region.US_EAST_1)
                .withCredentials(new ProfileCredentialsProvider())
                .build();

S3Client s3Client = S3Client.builder().region(Region.US_EAST_1).build();

Not getting what to use?

Upvotes: 7

Views: 12739

Answers (1)

smac2020
smac2020

Reputation: 10714

AmazonS3 is Java Version 1 and S3Client is Java version 2. It is strongly recommended that moving forward, you use Java Version 2. To learn about the difference between V1 and V2, read this document: https://docs.aws.amazon.com/sdk-for-java/latest/migration-guide/whats-different.html

Upvotes: 8

Related Questions