public class SetBucketPolicyRequest extends AmazonWebServiceRequest implements Serializable, ExpectedBucketOwnerRequest
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 User Guide for more information on forming bucket polices.
NOOP
Constructor and Description |
---|
SetBucketPolicyRequest() |
SetBucketPolicyRequest(String bucketName,
String policyText)
Creates a new request object, ready to be executed to set an Amazon S3
bucket's policy.
|
Modifier and Type | Method and Description |
---|---|
String |
getBucketName()
Returns the name of the Amazon S3 bucket whose policy is being set.
|
Boolean |
getConfirmRemoveSelfBucketAccess() |
String |
getExpectedBucketOwner()
Returns he account id of the expected bucket owner.
|
String |
getPolicyText()
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 |
setConfirmRemoveSelfBucketAccess(Boolean confirmRemoveSelfBucketAccess)
Set this parameter to true to confirm that you want to remove your permissions to change this bucket policy in the future.
|
void |
setExpectedBucketOwner(String expectedBucketOwner)
Set the account id of the expected bucket owner.
|
void |
setPolicyText(String policyText)
Sets the policy to apply to the specified bucket.
|
SetBucketPolicyRequest |
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.
|
SetBucketPolicyRequest |
withConfirmRemoveSelfBucketAccess(Boolean confirmRemoveSelfBucketAccess)
Set this parameter to true to confirm that you want to remove your permissions to change this bucket policy in the future.
|
SetBucketPolicyRequest |
withExpectedBucketOwner(String expectedBucketOwner)
Set the account id of the expected bucket owner.
|
SetBucketPolicyRequest |
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.
|
addHandlerContext, clone, copyBaseTo, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getHandlerContext, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestCredentialsProvider, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestCredentialsProvider, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestCredentialsProvider, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
public SetBucketPolicyRequest()
public SetBucketPolicyRequest(String bucketName, String policyText)
bucketName
- The name of the Amazon S3 bucket whose policy is being set.policyText
- The policy to apply to the specified bucket.public String getExpectedBucketOwner()
ExpectedBucketOwnerRequest
403 (Access Denied)
error.getExpectedBucketOwner
in interface ExpectedBucketOwnerRequest
public SetBucketPolicyRequest withExpectedBucketOwner(String expectedBucketOwner)
ExpectedBucketOwnerRequest
403 (Access Denied)
error.withExpectedBucketOwner
in interface ExpectedBucketOwnerRequest
public void setExpectedBucketOwner(String expectedBucketOwner)
ExpectedBucketOwnerRequest
403 (Access Denied)
error.setExpectedBucketOwner
in interface ExpectedBucketOwnerRequest
public String getBucketName()
public void setBucketName(String bucketName)
bucketName
- The name of the Amazon S3 bucket whose policy is being set.public SetBucketPolicyRequest withBucketName(String bucketName)
bucketName
- The name of the Amazon S3 bucket whose policy is being set.public String getPolicyText()
public void setPolicyText(String policyText)
policyText
- The policy to apply to the specified bucket.public SetBucketPolicyRequest withPolicyText(String policyText)
policyText
- The policy to apply to the specified bucket.public Boolean getConfirmRemoveSelfBucketAccess()
public void setConfirmRemoveSelfBucketAccess(Boolean confirmRemoveSelfBucketAccess)
confirmRemoveSelfBucketAccess
- New value for confirmRemoveSelfBucketAccess.public SetBucketPolicyRequest withConfirmRemoveSelfBucketAccess(Boolean confirmRemoveSelfBucketAccess)
confirmRemoveSelfBucketAccess
- New value for confirmRemoveSelfBucketAccess.Copyright © 2022. All rights reserved.