2

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?

Abhishek
  • 21
  • 1
  • 4

1 Answers1

5

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

smac2020
  • 9,637
  • 4
  • 24
  • 38