public class GetBucketPolicyRequest extends AmazonWebServiceRequest implements Serializable, ExpectedBucketOwnerRequest
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.
NOOP
Constructor and Description |
---|
GetBucketPolicyRequest(String bucketName)
Creates a new request object, ready to be executed to retrieve the bucket
policy of an Amazon S3 bucket.
|
Modifier and Type | Method and Description |
---|---|
String |
getBucketName()
Returns the name of the Amazon S3 bucket whose policy is being retrieved.
|
String |
getExpectedBucketOwner()
Returns he account id of the expected bucket owner.
|
void |
setBucketName(String bucketName)
Sets the name of the Amazon S3 bucket whose policy is being retrieved.
|
void |
setExpectedBucketOwner(String expectedBucketOwner)
Set the account id of the expected bucket owner.
|
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.
|
GetBucketPolicyRequest |
withExpectedBucketOwner(String expectedBucketOwner)
Set the account id of the expected bucket owner.
|
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 GetBucketPolicyRequest(String bucketName)
bucketName
- The name of the Amazon S3 bucket whose policy is being
retrieved.public String getExpectedBucketOwner()
ExpectedBucketOwnerRequest
403 (Access Denied)
error.getExpectedBucketOwner
in interface ExpectedBucketOwnerRequest
public GetBucketPolicyRequest 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
retrieved.public GetBucketPolicyRequest withBucketName(String bucketName)
bucketName
- The name of the Amazon S3 bucket whose policy is being
retrieved.Copyright © 2021. All rights reserved.