Package com.amazonaws.services.s3.model
Class SetBucketPolicyRequest
java.lang.Object
com.amazonaws.AmazonWebServiceRequest
com.amazonaws.services.s3.model.SetBucketPolicyRequest
- All Implemented Interfaces:
ReadLimitInfo
,Serializable
,Cloneable
Sets the policy associated with the specified bucket. Only the owner of
the bucket can set a bucket policy. If a policy already exists for the
specified bucket, the new policy replaces the existing policy.
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:
-
Field Summary
Fields inherited from class com.amazonaws.AmazonWebServiceRequest
NOOP
-
Constructor Summary
ConstructorsConstructorDescriptionSetBucketPolicyRequest
(String bucketName, String policyText) Creates a new request object, ready to be executed to set an Amazon S3 bucket's policy. -
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the Amazon S3 bucket whose policy is being set.Returns the policy to apply to the specified bucket.void
setBucketName
(String bucketName) Sets the name of the Amazon S3 bucket whose policy is being set.void
setPolicyText
(String policyText) Sets the policy to apply to the specified bucket.withBucketName
(String bucketName) Sets the name of the Amazon S3 bucket whose policy is being set, and returns the updated request object so that additional method calls can be chained together.withPolicyText
(String policyText) Sets the policy to apply to the specified bucket, and returns the updated request object so that additional method calls can be chained together.Methods inherited from class com.amazonaws.AmazonWebServiceRequest
clone, copyBaseTo, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestCredentialsProvider, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestCredentialsProvider, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
-
Constructor Details
-
SetBucketPolicyRequest
Creates a new request object, ready to be executed to set an Amazon S3 bucket's policy.- Parameters:
bucketName
- The name of the Amazon S3 bucket whose policy is being set.policyText
- The policy to apply to the specified bucket.
-
-
Method Details
-
getBucketName
Returns the name of the Amazon S3 bucket whose policy is being set.- Returns:
- The name of the Amazon S3 bucket whose policy is being set.
-
setBucketName
Sets the name of the Amazon S3 bucket whose policy is being set.- Parameters:
bucketName
- The name of the Amazon S3 bucket whose policy is being set.
-
withBucketName
Sets the name of the Amazon S3 bucket whose policy is being set, 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 set.- Returns:
- The updated request object so that additional method calls can be chained together.
-
getPolicyText
Returns the policy to apply to the specified bucket.- Returns:
- The policy to apply to the specified bucket.
-
setPolicyText
Sets the policy to apply to the specified bucket.- Parameters:
policyText
- The policy to apply to the specified bucket.
-
withPolicyText
Sets the policy to apply to the specified bucket, and returns the updated request object so that additional method calls can be chained together.- Parameters:
policyText
- The policy to apply to the specified bucket.- Returns:
- The updated request object, so that additional method calls can be chained together.
-