public class GetObjectRequest extends CosServiceRequest implements SSECustomerKeyProvider, Serializable
Constructor and Description |
---|
GetObjectRequest(COSObjectId cosObjectId) |
GetObjectRequest(String bucketName,
String key)
Constructs a new
GetObjectRequest with all the required parameters. |
GetObjectRequest(String bucketName,
String key,
String versionId)
Constructs a new
GetObjectRequest with all the required parameters. |
Modifier and Type | Method and Description |
---|---|
String |
getBucketName()
Gets the name of the bucket containing the object to be downloaded.
|
COSObjectId |
getCOSObjectId() |
int |
getDownloadPartsThreads() |
String |
getKey()
Gets the key under which the object to be downloaded is stored.
|
List<String> |
getMatchingETagConstraints()
Gets the optional list of ETag constraints that, when present, must include a match
for the object's current ETag in order for this request to be executed.
|
Date |
getModifiedSinceConstraint()
Gets the optional modified constraint that restricts this request to executing only if the
object has been modified after the specified date.
|
List<String> |
getNonmatchingETagConstraints()
Gets the optional list of ETag constraints that when present, must not include a match
for the object's current ETag in order for this request to be executed.
|
long[] |
getRange()
Gets the optional inclusive byte range within the desired object that will be downloaded by
this request.
|
ResponseHeaderOverrides |
getResponseHeaders()
Returns the headers to be overridden in the service response.
|
SSECustomerKey |
getSSECustomerKey()
Returns the optional customer-provided server-side encryption key to use
to encrypt the uploaded object.
|
int |
getTrafficLimit() |
Date |
getUnmodifiedSinceConstraint()
Gets the optional unmodified constraint that restricts this request to executing only if the
object has not been modified after the specified date.
|
String |
getVersionId()
Gets the optional version ID specifying which version of the object to download.
|
void |
setBucketName(String bucketName)
Sets the name of the bucket containing the object to be downloaded.
|
void |
setDownloadPartsThreads(int downloadThreads) |
void |
setKey(String key)
Sets the key under which the object to be downloaded is stored.
|
void |
setMatchingETagConstraints(List<String> eTagList)
Sets the optional list of ETag constraints that when present must include a match for
the object's current ETag in order for this request to be executed.
|
void |
setModifiedSinceConstraint(Date date)
Sets the optional modified constraint that restricts this request to executing only if the
object has been modified after the specified date.
|
void |
setNonmatchingETagConstraints(List<String> eTagList)
Sets the optional list of ETag constraints that when present must not include a match
for the object's current ETag in order for this request to be executed.
|
void |
setRange(long start,
long end)
Sets the optional inclusive byte range within the desired object that will be downloaded by
this request.
|
void |
setRangeEnd(long end) |
void |
setRangeStart(long start) |
void |
setResponseHeaders(ResponseHeaderOverrides responseHeaders)
Sets the headers to be overridden in the service response.
|
void |
setSSECustomerKey(SSECustomerKey sseKey)
Sets the optional customer-provided server-side encryption key to use to decrypt this object.
|
void |
setTrafficLimit(int trafficLimit) |
void |
setUnmodifiedSinceConstraint(Date date)
Sets the optional unmodified constraint that restricts this request to executing only if the
object has not been modified after the specified date.
|
void |
setVersionId(String versionId)
Sets the optional version ID specifying which version of the object to download.
|
GetObjectRequest |
withBucketName(String bucketName)
Sets the name of the bucket containing the object to be downloaded.
|
GetObjectRequest |
withKey(String key)
Sets the key under which the object to be downloaded is stored.
|
GetObjectRequest |
withMatchingETagConstraint(String eTag)
Sets a single ETag constraint to this request.
|
GetObjectRequest |
withModifiedSinceConstraint(Date date)
Sets the optional modified constraint that restricts this request to executing only if the
object has been modified after the specified date.
|
GetObjectRequest |
withNonmatchingETagConstraint(String eTag)
Sets a single ETag constraint to this request.
|
GetObjectRequest |
withRange(long start,
long end)
Sets the optional inclusive byte range within the desired object that will be downloaded by
this request.
|
GetObjectRequest |
withResponseHeaders(ResponseHeaderOverrides responseHeaders)
Sets the headers to be overridden in the service response and returns this object, for method
chaining.
|
GetObjectRequest |
withSSECustomerKey(SSECustomerKey sseKey)
Sets the optional customer-provided server-side encryption key to use to decrypt this object,
and returns the updated GetObjectRequest so that additional method calls may be chained
together.
|
GetObjectRequest |
withUnmodifiedSinceConstraint(Date date)
Sets the optional unmodified constraint that restricts this request to executing only if the
object has not been modified after the specified date.
|
GetObjectRequest |
withVersionId(String versionId)
Sets the optional version ID specifying which version of the object to download and returns
this object, enabling additional method calls to be chained together.
|
clone, copyBaseTo, getCiSpecialEndParameter, getCloneRoot, getCloneSource, getCosCredentials, getCustomQueryParameters, getCustomRequestHeaders, getFixedEndpointAddr, getGeneralProgressListener, getReadLimit, getRequestClientOptions, putCustomQueryParameter, putCustomRequestHeader, setCiSpecialEndParameter, setCosCredentials, setFixedEndpointAddr, setGeneralProgressListener, withGeneralProgressListener
public GetObjectRequest(COSObjectId cosObjectId)
public GetObjectRequest(String bucketName, String key)
GetObjectRequest
with all the required parameters.bucketName
- The name of the bucket containing the desired object.key
- The key in the specified bucket under which the object is stored.GetObjectRequest(String, String, String)
public GetObjectRequest(String bucketName, String key, String versionId)
GetObjectRequest
with all the required parameters.bucketName
- The name of the bucket containing the desired object.key
- The key in the specified bucket under which the object is stored.versionId
- The Qcloud COS version ID specifying a specific version of the object to
download.GetObjectRequest(String, String)
public String getBucketName()
setBucketName(String)
,
withBucketName(String)
public void setBucketName(String bucketName)
bucketName
- The name of the bucket containing the object to be downloaded.getBucketName()
,
withBucketName(String)
public GetObjectRequest withBucketName(String bucketName)
GetObjectRequest
, enabling additional method calls to be chained together.bucketName
- The name of the bucket containing the object to be downloaded.GetObjectRequest
, enabling additional method calls to be chained
together.getBucketName()
,
setBucketName(String)
public String getKey()
setKey(String)
,
withKey(String)
public void setKey(String key)
key
- The key under which the object to be downloaded is stored.getKey()
,
withKey(String)
public GetObjectRequest withKey(String key)
GetObjectRequest
, enabling additional method calls to be chained together.key
- The key under which the object to be downloaded is stored.GetObjectRequest
, enabling additional method calls to be chained
together.getKey()
,
setKey(String)
public String getVersionId()
Gets the optional version ID specifying which version of the object to download. If not specified, the most recent version will be downloaded.
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
COS#setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest)
.
setVersionId(String)
,
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
COS#setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest)
.
versionId
- The optional version ID specifying which version of the object to download.getVersionId()
,
withVersionId(String)
public GetObjectRequest withVersionId(String versionId)
Sets the optional version ID specifying which version of the object to download and returns this object, enabling additional method calls to be chained together. If not specified, the most recent version will be downloaded.
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
COS#setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest)
.
versionId
- The optional version ID specifying which version of the object to download.getVersionId()
,
setVersionId(String)
public long[] getRange()
Gets the optional inclusive byte range within the desired object that will be downloaded by this request.
The range is returned as a two element array, containing the start and end index of the byte
range. If no byte range has been specified, the entire object is downloaded and this method
returns null
.
null
if no range has
been specified, and the whole object is to be downloaded.GetObjectMetadataRequest#setRange(long, long)
,
withRange(long, long)
public void setRange(long start, long end)
Sets the optional inclusive byte range within the desired object that will be downloaded by this request.
The first byte in an object has position 0; as an example, the first ten bytes of an object can be downloaded by specifying a range of 0 to 9.
If no byte range is specified, this request downloads the entire object from Qcloud COS.
start
- The start of the inclusive byte range to download.end
- The end of the inclusive byte range to download.GetObjectMetadataRequest#getRange()
,
withRange(long, long)
public void setRangeStart(long start)
public void setRangeEnd(long end)
public GetObjectRequest withRange(long start, long end)
Sets the optional inclusive byte range within the desired object that will be downloaded by
this request. Returns this GetObjectRequest
, enabling additional method calls to be
chained together.
The first byte in an object has position 0; as an example, the first ten bytes of an object can be downloaded by specifying a range of 0 to 9.
If no byte range is specified, this request downloads the entire object from Qcloud COS.
start
- The start of the inclusive byte range to download.end
- The end of the inclusive byte range to download.GetObjectRequest
, enabling additional method calls to be chained
together.getRange()
,
setRange(long, long)
public List<String> getMatchingETagConstraints()
setMatchingETagConstraints(List)
,
withMatchingETagConstraint(String)
public void setMatchingETagConstraints(List<String> eTagList)
eTagList
- The optional list of ETag constraints that must include a match for
the object's current ETag in order for this request to be executed.getMatchingETagConstraints()
,
withMatchingETagConstraint(String)
public GetObjectRequest withMatchingETagConstraint(String eTag)
GetObjectRequest
,
enabling additional method calls to be chained together.
Multiple ETag constraints can be added to a request, but one must match the object's current ETag in order for this request to be executed. If none of the ETag constraints added to this request match the object's current ETag, this request will not be executed by Qcloud COS.
eTag
- The matching ETag constraint to add to this request.GetObjectRequest
, enabling additional method calls to be chained
together.getMatchingETagConstraints()
,
setMatchingETagConstraints(List)
public List<String> getNonmatchingETagConstraints()
setNonmatchingETagConstraints(List)
,
withNonmatchingETagConstraint(String)
public void setNonmatchingETagConstraints(List<String> eTagList)
eTagList
- The list of ETag constraints that, when present, must not include a
match for the object's current ETag in order for this request to be executed.getNonmatchingETagConstraints()
,
withNonmatchingETagConstraint(String)
public GetObjectRequest withNonmatchingETagConstraint(String eTag)
GetObjectRequest
,
enabling additional method calls to be chained together.
Multiple ETag constraints can be added to a request, but all ETag constraints must not match the object's current ETag in order for this request to be executed. If any entry in the non-matching ETag constraint list matches the object's current ETag, this request will not be executed by Qcloud COS.
eTag
- The non-matching ETag constraint to add to this request.GetObjectRequest
, enabling additional method calls to be chained
together.getNonmatchingETagConstraints()
,
setNonmatchingETagConstraints(List)
public Date getUnmodifiedSinceConstraint()
setUnmodifiedSinceConstraint(Date)
,
withUnmodifiedSinceConstraint(Date)
public void setUnmodifiedSinceConstraint(Date date)
Note that Qcloud COS will ignore any dates occurring in the future.
date
- The unmodified constraint that restricts this request to executing only if the
object has not been modified after this date.getUnmodifiedSinceConstraint()
,
withUnmodifiedSinceConstraint(Date)
public GetObjectRequest withUnmodifiedSinceConstraint(Date date)
GetObjectRequest
, enabling additional method calls to be chained together.
Note that Qcloud COS will ignore any dates occurring in the future.
date
- The unmodified constraint that restricts this request to executing only if the
object has not been modified after this date.GetObjectRequest
, enabling additional method calls to be chained
together.getUnmodifiedSinceConstraint()
,
setUnmodifiedSinceConstraint(Date)
public Date getModifiedSinceConstraint()
setModifiedSinceConstraint(Date)
,
withModifiedSinceConstraint(Date)
public void setModifiedSinceConstraint(Date date)
Note that Qcloud COS will ignore any dates occurring in the future.
date
- The modified constraint that restricts this request to executing only if the
object has been modified after the specified date.getModifiedSinceConstraint()
,
withModifiedSinceConstraint(Date)
public GetObjectRequest withModifiedSinceConstraint(Date date)
GetObjectRequest
, enabling additional method calls to be chained together.
Note that Qcloud COS will ignore any dates occurring in the future.
date
- The modified constraint that restricts this request to executing only if the
object has been modified after the specified date.GetObjectRequest
, enabling additional method calls to be chained
together.getModifiedSinceConstraint()
,
setModifiedSinceConstraint(Date)
public ResponseHeaderOverrides getResponseHeaders()
public void setResponseHeaders(ResponseHeaderOverrides responseHeaders)
responseHeaders
- The headers to be overridden in the service response.public GetObjectRequest withResponseHeaders(ResponseHeaderOverrides responseHeaders)
responseHeaders
- The headers to be overridden in the service response.GetObjectRequest
for method chaining.public SSECustomerKey getSSECustomerKey()
SSECustomerKeyProvider
getSSECustomerKey
in interface SSECustomerKeyProvider
public void setSSECustomerKey(SSECustomerKey sseKey)
sseKey
- The optional customer-provided server-side encryption key to use to decrypt
this object.public GetObjectRequest withSSECustomerKey(SSECustomerKey sseKey)
sseKey
- The optional customer-provided server-side encryption key to use to decrypt
this object.public COSObjectId getCOSObjectId()
public int getTrafficLimit()
public void setTrafficLimit(int trafficLimit)
public void setDownloadPartsThreads(int downloadThreads)
public int getDownloadPartsThreads()
Copyright © 2024. All rights reserved.