org.jclouds.s3.domain
Enum CannedAccessPolicy

java.lang.Object
  extended by java.lang.Enum<CannedAccessPolicy>
      extended by org.jclouds.s3.domain.CannedAccessPolicy
All Implemented Interfaces:
Serializable, Comparable<CannedAccessPolicy>

public enum CannedAccessPolicy
extends Enum<CannedAccessPolicy>

Description from Amazon's documentation:

Because of restrictions in what can be sent via http headers, Amazon S3 supports the concept of canned access policies for REST. A canned access policy can be included with the x-amz-acl header as part of a PUT operation to provide shorthand representation of a full access policy. When Amazon S3 sees the x-amz-acl header as part of a PUT operation, it will assign the respective access policy to the resource created as a result of the PUT. If no x-amz-acl header is included with a PUT request, then the bucket or object is written with the private access control policy (even if, in the case of an object, the object already exists with some other pre-existing access control policy).

Author:
Adrian Cole
See Also:

Enum Constant Summary
AUTHENTICATED_READ
          Owner gets FULL_CONTROL, and any identity authenticated as a registered Amazon S3 user is granted READ access.
PRIVATE
          Owner gets FULL_CONTROL.
PUBLIC_READ
          Owner gets FULL_CONTROL and the anonymous identity is granted READ access.
PUBLIC_READ_WRITE
          Owner gets FULL_CONTROL, the anonymous identity is granted READ and WRITE access.
 
Method Summary
static CannedAccessPolicy fromHeader(String capHeader)
           
 String toString()
           
static CannedAccessPolicy valueOf(String name)
          Returns the enum constant of this type with the specified name.
static CannedAccessPolicy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PRIVATE

public static final CannedAccessPolicy PRIVATE
Owner gets FULL_CONTROL. No one else has access rights (default).


PUBLIC_READ

public static final CannedAccessPolicy PUBLIC_READ
Owner gets FULL_CONTROL and the anonymous identity is granted READ access. If this policy is used on an object, it can be read from a browser with no authentication.


PUBLIC_READ_WRITE

public static final CannedAccessPolicy PUBLIC_READ_WRITE
Owner gets FULL_CONTROL, the anonymous identity is granted READ and WRITE access. This can be a useful policy to apply to a bucket, but is generally not recommended.


AUTHENTICATED_READ

public static final CannedAccessPolicy AUTHENTICATED_READ
Owner gets FULL_CONTROL, and any identity authenticated as a registered Amazon S3 user is granted READ access.

Method Detail

values

public static CannedAccessPolicy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (CannedAccessPolicy c : CannedAccessPolicy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static CannedAccessPolicy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toString

public String toString()
Overrides:
toString in class Enum<CannedAccessPolicy>

fromHeader

public static CannedAccessPolicy fromHeader(String capHeader)
Parameters:
capHeader - The value of the x-amz-acl HTTP Header returned by S3 when an object has a canned access policy.
Returns:
the canned access policy object corresponding to the header value, or null if the given header value does not represent a valid canned policy.


Copyright © 2009-2011 jclouds. All Rights Reserved.