Difference between AmazonS3 vs S3Client

9.7k Views Asked by At

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?

1

There are 1 best solutions below

0
On

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