Skip to content

Commit c6ac4a7

Browse files
author
Huntsperger
committed
adding minimal example of getting and setting bucket acls
1 parent 6e462f7 commit c6ac4a7

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
3+
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0
4+
International License (the "License"). You may not use this file except in compliance with the
5+
License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/.
6+
7+
This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
8+
either express or implied. See the License for the specific language governing permissions and
9+
limitations under the License.
10+
11+
#######################################
12+
Managing |S3| Bucket Access Permissions
13+
#######################################
14+
15+
.. meta::
16+
:description: How to retrieve or set the access control list for an Amazon S3 bucket.
17+
:keywords: AWS for Java SDK code examples, bucket access permissions
18+
19+
You can get or set the access control list for an Amazon S3 bucket.
20+
21+
.. include:: includes/examples-note.txt
22+
23+
Get the Current Bucket Access Control List
24+
==========================================
25+
26+
**Imports**
27+
28+
.. literalinclude:: example_code/s3/src/main/java/aws/example/s3/GetAcl.java
29+
:lines: 16-21
30+
31+
**Code**
32+
33+
.. literalinclude:: example_code/s3/src/main/java/aws/example/s3/GetAcl.java
34+
:lines: 31-47
35+
:dedent: 4
36+
37+
See the :sdk-examples-java-s3:`complete example <GetAcl.java>`.
38+
39+
Set a Bucket Access Control List
40+
================================
41+
42+
**Imports**
43+
44+
.. literalinclude:: example_code/s3/src/main/java/aws/example/s3/SetAcl.java
45+
:lines: 16-22
46+
47+
**Code**
48+
49+
.. literalinclude:: example_code/s3/src/main/java/aws/example/s3/SetAcl.java
50+
:lines: 33-51
51+
:dedent: 4
52+
53+
See the :sdk-examples-java-s3:`complete example <SetAcl.java>`.

doc_source/examples-s3.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This section provides examples of programming |S3|_ using the |sdk-java|_.
2727

2828
examples-s3-buckets
2929
examples-s3-objects
30+
examples-s3-access-permissions
3031
examples-s3-bucket-policies
3132
examples-s3-transfermanager
3233
examples-s3-website-configuration
33-

0 commit comments

Comments
 (0)