public class GetObjectAclRequest extends AmazonWebServiceRequest implements WormMirrorDestinationProvider, Serializable
Provide options to get an object ACL.
Each bucket and object in Amazon S3 has an ACL that defines its access control policy. When a request is made, Amazon S3 authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, Amazon S3 returns an error.
NOOP
Constructor and Description |
---|
GetObjectAclRequest(String bucketName,
String key) |
GetObjectAclRequest(String bucketName,
String key,
String versionId) |
Modifier and Type | Method and Description |
---|---|
String |
getBucketName()
The bucket name that contains the object for which to get the ACL information.
|
String |
getKey()
Gets the key under which the object whose ACL to be retrieved is stored.
|
String |
getVersionId()
Gets the optional version ID specifying which version of the object whose ACL to
be retrieved.
|
String |
getWormMirrorDestination()
Returns the optional mirror-destination value for WORM mirroring
|
boolean |
isRequesterPays()
Returns true if the user has enabled Requester Pays option when
conducting this operation from Requester Pays Bucket; else false.
|
void |
setBucketName(String bucketName)
The bucket name that contains the object for which to get the ACL information.
|
void |
setKey(String key)
Sets the key under which the object whose ACL to be retrieved is stored.
|
void |
setRequesterPays(boolean isRequesterPays)
Used for conducting this operation from a Requester Pays Bucket.
|
void |
setVersionId(String versionId)
Sets the optional version ID specifying which version of the object whose ACL to
be retrieved.
|
void |
setWormMirrorDestination(String wormMirrorDestination)
Sets the optional mirror-destination value for WORM mirroring
|
GetObjectAclRequest |
withBucket(String bucketName)
The bucket name that contains the object for which to get the ACL information.
|
GetObjectAclRequest |
withKey(String key)
Sets the key under which the object whose ACL to be retrieved is stored.
|
GetObjectAclRequest |
withRequesterPays(boolean isRequesterPays)
Used for conducting this operation from a Requester Pays Bucket.
|
GetObjectAclRequest |
withVersionId(String versionId)
Sets the optional version ID specifying which version of the object whose ACL to be
retrieved and returns this
GetObjectAclRequest , enabling additional method calls to be
chained together. |
GetObjectAclRequest |
withWormMirrorDestination(String wormMirrorDestination)
Sets the optional mirror-destination value for WORM mirroring
and returns the updated GetObjectAclRequest so that additional
method calls may 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 String getBucketName()
The bucket name that contains the object for which to get the ACL information.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
GetObjectAclRequest.setBucketName(String)
,
GetObjectAclRequest.withBucket(String)
public void setBucketName(String bucketName)
The bucket name that contains the object for which to get the ACL information.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
bucketName
- The bucket name that contains the object for which to get the ACL information.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
GetObjectAclRequest.getBucketName()
,
GetObjectAclRequest.withBucket(String)
public GetObjectAclRequest withBucket(String bucketName)
The bucket name that contains the object for which to get the ACL information.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
bucketName
- The bucket name that contains the object for which to get the ACL information.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
GetObjectAclRequest
, enabling additional method
calls to be chained together.GetObjectAclRequest.getBucketName()
,
GetObjectAclRequest.setBucketName(String)
public String getKey()
GetObjectAclRequest.setKey(String)
,
GetObjectAclRequest.withKey(String)
public void setKey(String key)
key
- The key under which the object whose ACL to be retrieved is stored.GetObjectAclRequest.getKey()
,
GetObjectAclRequest.withKey(String)
public GetObjectAclRequest withKey(String key)
GetObjectAclRequest
, enabling additional method
calls to be chained together.key
- The key under which the object whose ACL to be retrieved is stored.GetObjectAclRequest
, enabling additional method
calls to be chained together.GetObjectAclRequest.getKey()
,
GetObjectAclRequest.setKey(String)
public String getVersionId()
Gets the optional version ID specifying which version of the object whose ACL to be retrieved. If not specified, the most recent version's ACL will be retrieved.
Objects created before versioning was enabled or when versioning is
suspended are given the default null
version ID (see
Constants.NULL_VERSION_ID
). Note that the
null
version ID is a valid version ID and is not the
same as not having a version ID.
For more information about enabling versioning for a bucket, see
AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest)
.
GetObjectAclRequest.setVersionId(String)
,
GetObjectAclRequest.withVersionId(String)
public void setVersionId(String versionId)
Objects created before versioning was enabled or when versioning is
suspended will be given the default null
version ID (see
Constants.NULL_VERSION_ID
). Note that the
null
version ID is a valid version ID and is not the
same as not having a version ID.
For more information about enabling versioning for a bucket, see
AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest)
.
versionId
- The optional version ID specifying which version of the object whose ACL
to be retrieved.GetObjectAclRequest.getVersionId()
,
GetObjectAclRequest.withVersionId(String)
public GetObjectAclRequest withVersionId(String versionId)
Sets the optional version ID specifying which version of the object whose ACL to be
retrieved and returns this GetObjectAclRequest
, enabling additional method calls to be
chained together. If not specified, the most recent version's ACL will be
retrieved.
Objects created before versioning was enabled or when versioning is
suspended will be given the default or null
version ID (see
Constants.NULL_VERSION_ID
). Note that the
null
version ID is a valid version ID and is not the
same as not having a version ID.
For more information about enabling versioning for a bucket, see
AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest)
.
versionId
- The optional version ID specifying which version of the object whose ACL is
to be retrieved.GetObjectAclRequest.getVersionId()
,
GetObjectAclRequest.setVersionId(String)
public boolean isRequesterPays()
If a bucket is enabled for Requester Pays, then any attempt to upload or download an object from it without Requester Pays enabled will result in a 403 error and the bucket owner will be charged for the request.
Enabling Requester Pays disables the ability to have anonymous access to this bucket
public void setRequesterPays(boolean isRequesterPays)
If a bucket is enabled for Requester Pays, then any attempt to upload or download an object from it without Requester Pays enabled will result in a 403 error and the bucket owner will be charged for the request.
Enabling Requester Pays disables the ability to have anonymous access to this bucket.
isRequesterPays
- Enable Requester Pays option for the operation.public GetObjectAclRequest withRequesterPays(boolean isRequesterPays)
If a bucket is enabled for Requester Pays, then any attempt to upload or download an object from it without Requester Pays enabled will result in a 403 error and the bucket owner will be charged for the request.
Enabling Requester Pays disables the ability to have anonymous access to this bucket.
isRequesterPays
- Enable Requester Pays option for the operation.public String getWormMirrorDestination()
getWormMirrorDestination
in interface WormMirrorDestinationProvider
public void setWormMirrorDestination(String wormMirrorDestination)
setWormMirrorDestination
in interface WormMirrorDestinationProvider
wormMirrorDestination
- The optional mirror-destination value for WORM mirroringpublic GetObjectAclRequest withWormMirrorDestination(String wormMirrorDestination)
wormMirrorDestination
- The optional mirror-destination value for WORM mirroringGetObjectAclRequest
, enabling additional method
calls to be chained together.Copyright © 2024. All rights reserved.