|
| 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>`. |
0 commit comments