Class GetObjectAclRequest
- All Implemented Interfaces:
ReadLimitInfo
,Serializable
,Cloneable
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.
-
Field Summary
Fields inherited from class com.amazonaws.AmazonWebServiceRequest
NOOP
-
Constructor Summary
ConstructorsConstructorDescriptionGetObjectAclRequest
(String bucketName, String key) GetObjectAclRequest
(String bucketName, String key, String versionId) -
Method Summary
Modifier and TypeMethodDescriptionGets the name of the bucket containing the object whose ACL is to be retrieved.getKey()
Gets the key under which the object whose ACL to be retrieved is stored.Gets the optional version ID specifying which version of the object whose ACL to be retrieved.boolean
Returns true if the user has enabled Requester Pays option when conducting this operation from Requester Pays Bucket; else false.void
setBucketName
(String bucketName) Sets the name of the bucket containing the object whose ACL is to be retrieved.void
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.withBucket
(String bucketName) Sets the name of the bucket containing the object whose ACL is to be retrieved.Sets the key under which the object whose ACL to be retrieved is stored.withRequesterPays
(boolean isRequesterPays) Used for conducting this operation from a Requester Pays Bucket.withVersionId
(String versionId) Sets the optional version ID specifying which version of the object whose ACL to be retrieved and returns thisGetObjectAclRequest
, enabling additional method calls to 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
-
GetObjectAclRequest
-
GetObjectAclRequest
-
-
Method Details
-
getBucketName
Gets the name of the bucket containing the object whose ACL is to be retrieved.- Returns:
- The name of the bucket containing the object whose ACL is to be retrieved.
- See Also:
-
setBucketName
Sets the name of the bucket containing the object whose ACL is to be retrieved.- Parameters:
bucketName
- The name of the bucket containing the object whose ACL is to be retrieved.- See Also:
-
withBucket
Sets the name of the bucket containing the object whose ACL is to be retrieved. Returns thisGetObjectAclRequest
, enabling additional method calls to be chained together.- Parameters:
bucketName
- The name of the bucket containing the object whose ACL is to be retrieved.- Returns:
- This
GetObjectAclRequest
, enabling additional method calls to be chained together. - See Also:
-
getKey
Gets the key under which the object whose ACL to be retrieved is stored.- Returns:
- The key under which the object whose ACL to be retrieved is stored.
- See Also:
-
setKey
Sets the key under which the object whose ACL to be retrieved is stored.- Parameters:
key
- The key under which the object whose ACL to be retrieved is stored.- See Also:
-
withKey
Sets the key under which the object whose ACL to be retrieved is stored. Returns thisGetObjectAclRequest
, enabling additional method calls to be chained together.- Parameters:
key
- The key under which the object whose ACL to be retrieved is stored.- Returns:
- This
GetObjectAclRequest
, enabling additional method calls to be chained together. - See Also:
-
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 (seeConstants.NULL_VERSION_ID
). Note that thenull
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)
.- Returns:
- The optional version ID specifying which version of the object whose ACL to be retrieved. If not specified, the most recent version will be retrieved.
- See Also:
-
setVersionId
Sets 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 will be given the default
null
version ID (seeConstants.NULL_VERSION_ID
). Note that thenull
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)
.- Parameters:
versionId
- The optional version ID specifying which version of the object whose ACL to be retrieved.- See Also:
-
withVersionId
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 (seeConstants.NULL_VERSION_ID
). Note that thenull
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)
.- Parameters:
versionId
- The optional version ID specifying which version of the object whose ACL is to be retrieved.- Returns:
- The updated request object, enabling additional method calls to be chained together.
- See Also:
-
isRequesterPays
public boolean isRequesterPays()Returns true if the user has enabled Requester Pays option when conducting this operation from Requester Pays Bucket; else false.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
- Returns:
- true if the user has enabled Requester Pays option for conducting this operation from Requester Pays Bucket.
-
setRequesterPays
public void setRequesterPays(boolean isRequesterPays) Used for conducting this operation from a Requester Pays Bucket. If set the requester is charged for requests from the bucket.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.
- Parameters:
isRequesterPays
- Enable Requester Pays option for the operation.
-
withRequesterPays
Used for conducting this operation from a Requester Pays Bucket. If set the requester is charged for requests from the bucket. It returns this updated GetObjectAclRequest object so that additional method calls can be chained together.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.
- Parameters:
isRequesterPays
- Enable Requester Pays option for the operation.- Returns:
- The updated GetObjectAclRequest object.
-