Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * Copyright 2010, Inc. or its affiliates. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
  * or in the "license" file accompanying this file. This file is distributed
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.

Specifies constants defining a group of Amazon S3 users who can be granted permissions to Amazon S3 buckets and objects. This enumeration contains all the valid Amazon S3 group grantees.
 public enum GroupGrantee implements Grantee {

Grants anonymous access to any Amazon S3 object or bucket. Any user will be able to access the object by omitting the AWS Key ID and Signature from a request.

Amazon highly recommends that users do not grant the AllUsers group write access to their buckets. If granted, users will have no control over the objects others can store and their associated charges.


Grants access to buckets or objects to anyone with an Amazon AWS account. Although this is inherently insecure as any AWS user who is aware of the bucket or object will be able to access it, users may find this authentication method useful.

Grants access to Amazon S3 log delivery so that an S3 bucket can receive server access logs. Turning on server access logging for an Amazon S3 bucket requires that the bucket receiving the logs is granted permission for the log delivery group to deliver logs.
     private String groupUri;
     private GroupGrantee(String groupUri) {
         this. = groupUri;
Gets the group grantee's URI.

The group grantee's URI.
     public String getIdentifier() {
         return ;

For internal use only. Group grantees have preset identifiers that cannot be modified.
     public void setIdentifier(String id) {
         throw new UnsupportedOperationException(
                 "Group grantees have preset identifiers that cannot be modified.");
     public String toString() {
         return "GroupGrantee [" +  + "]";

Gets the GroupGrantee enumeration value with the specified Amazon S3 group URI (eg. Returns null if an invalid Amazon S3 group URI is specified.

groupUri A string representation of an Amazon S3 group URI (eg.
The GroupGrantee object represented by the given Amazon S3 group URI string. Returns null if the string isn't a valid Amazon S3 group URI.
    public static GroupGrantee parseGroupGrantee(String groupUri) {
        for (GroupGrantee grantee : GroupGrantee.values()) {
            if (grantee.groupUri.equals(groupUri)) {
                return grantee;
        return null;
New to GrepCode? Check out our FAQ X