Enum 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).

    • 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.
      • AWS_EXEC_READ

        public static final CannedAccessPolicy AWS_EXEC_READ
        Owner gets FULL_CONTROL. Amazon EC2 gets READ access to GET an Amazon Machine Image (AMI) bundle from Amazon S3.
      • 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.
      • BUCKET_OWNER_READ

        public static final CannedAccessPolicy BUCKET_OWNER_READ
        Object owner gets FULL_CONTROL. Bucket owner gets READ access. If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
      • BUCKET_OWNER_FULL_CONTROL

        public static final CannedAccessPolicy BUCKET_OWNER_FULL_CONTROL
        Both the object owner and the bucket owner get FULL_CONTROL over the object. If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
      • LOG_DELIVERY_WRITE

        public static final CannedAccessPolicy LOG_DELIVERY_WRITE
        The LogDelivery group gets WRITE and READ_ACP permissions on the bucket. For more information about logs, see (Server Access Logging).
    • 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
      • 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.