Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 840
Abhishek Avatar asked Jul 31 '26 03:07

Abhishek


1 Answers

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

like image 123
smac2020 Avatar answered Aug 02 '26 20:08

smac2020



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!