How do you make S3 Object public via Java SDK

0 votes

How do you make an S3 object public via the AWS Java SDK?

Specifically, what API methods via the Java AWS SDK can be used to make an Object public when it's uploaded?

Oct 16, 2018 in AWS by datageek
• 2,540 points
2,515 views

1 answer to this question.

0 votes

Found the answer in an AWS Documentation

return s3Client.putObject(
   new PutObjectRequest(bucketName, objectKey, inputStream, metadata)
      .withCannedAcl(CannedAccessControlList.PublicRead));

The answer being

.withCannedAcl(CannedAccessControlList.PublicRead)

answered Oct 16, 2018 by Archana
• 4,170 points

Related Questions In AWS

0 votes
1 answer

How do I write an S3 Object to a file?

While IOUtils.copy() and IOUtils.copyLarge() are great, I would prefer the old ...READ MORE

answered Jul 13, 2018 in AWS by Hammer
• 360 points
4,642 views
0 votes
1 answer

How to make a S3 bucket public?

You can change the setting according to ...READ MORE

answered Feb 13, 2019 in AWS by Priyaj
• 58,020 points
739 views
0 votes
1 answer

How to make a S3 bucket public?

create a bucket policy with the following ...READ MORE

answered Mar 12, 2019 in AWS by Reena
976 views
0 votes
1 answer
+4 votes
5 answers

Usage of Amazon Cloudfront or S3

When to use S3? S3 is like many ...READ MORE

answered Apr 3, 2018 in AWS by brat_1
• 7,200 points
1,972 views
+3 votes
6 answers

Renaming files in S3

You can either use AWS CLI or ...READ MORE

answered Oct 16, 2018 in AWS by petter dj
31,210 views
0 votes
1 answer

S3 Static Website Hosting Route All Paths to Index.html

Yes there is an easy way to ...READ MORE

answered Apr 8, 2018 in AWS by code_ninja
• 6,300 points
3,439 views
+1 vote
4 answers

Can a URL be directly uploaded to S3 using POST?

You can read this blog and get ...READ MORE

answered Oct 25, 2018 in AWS by chamunda
3,286 views
0 votes
1 answer

How do you concatenate small sized files in Amazon S3?

Amazon S3 does not provide a concatenate ...READ MORE

answered Sep 3, 2018 in AWS by Archana
• 4,170 points
5,357 views
0 votes
1 answer

How to make multiple files in Amazon S3 public?

I had to change several hundred thousand ...READ MORE

answered Oct 17, 2018 in AWS by Archana
• 4,170 points
1,082 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP