Class GetBucketPolicyRequest

java.lang.Object
com.amazonaws.AmazonWebServiceRequest
com.amazonaws.services.s3.model.GetBucketPolicyRequest
All Implemented Interfaces:
ReadLimitInfo, Serializable, Cloneable

public class GetBucketPolicyRequest extends AmazonWebServiceRequest implements Serializable

Gets the policy for the specified bucket. Only the owner of the bucket can retrieve the policy. If no policy has been set for the bucket, then an empty result object with a null policy text field will be returned.

Bucket policies provide access control management at the bucket level for both the bucket resource and contained object resources. Only one policy can be specified per-bucket.

See the Amazon S3 developer guide for more information on forming bucket polices.

See Also:
  • Constructor Details

    • GetBucketPolicyRequest

      public GetBucketPolicyRequest(String bucketName)
      Creates a new request object, ready to be executed to retrieve the bucket policy of an Amazon S3 bucket.
      Parameters:
      bucketName - The name of the Amazon S3 bucket whose policy is being retrieved.
  • Method Details

    • getBucketName

      public String getBucketName()
      Returns the name of the Amazon S3 bucket whose policy is being retrieved.
      Returns:
      The name of the Amazon S3 bucket whose policy is being retrieved.
    • setBucketName

      public void setBucketName(String bucketName)
      Sets the name of the Amazon S3 bucket whose policy is being retrieved.
      Parameters:
      bucketName - The name of the Amazon S3 bucket whose policy is being retrieved.
    • withBucketName

      public GetBucketPolicyRequest withBucketName(String bucketName)
      Sets the name of the Amazon S3 bucket whose policy is being retrieved, and returns the updated request object so that additional method calls can be chained together.
      Parameters:
      bucketName - The name of the Amazon S3 bucket whose policy is being retrieved.
      Returns:
      The updated request object so that additional method calls can be chained together.