com.netease.cloud.services.nos.model
public class GetObjectRequest extends WebServiceRequest
Provides options for downloading an object.
All GetObjectRequests
must specify a bucket name and key. Beyond
that, requests can also specify:
GetObjectRequest(String, String)
,
GetObjectRequest#GetObjectRequest(String, String, String)
,
GetObjectMetadataRequest
logID, logSeq
Constructor and Description |
---|
GetObjectRequest(String bucketName,
String key)
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.
|
String |
getKey()
Gets the key under which the object to be downloaded is stored.
|
Date |
getModifiedSinceConstraint()
Gets the optional modified constraint that restricts this request to
executing only if the object has been modified after the specified
date.
|
ProgressListener |
getProgressListener()
Returns the optional progress listener for receiving updates about object
download status.
|
long[] |
getRange()
Gets the optional inclusive byte range within the desired object that
will be downloaded by this request.
|
void |
setBucketName(String bucketName)
Sets the name of the bucket containing the object to be downloaded.
|
void |
setKey(String key)
Sets the key under which the object to be downloaded is stored.
|
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 |
setProgressListener(ProgressListener progressListener)
Sets the optional progress listener for receiving updates about object
download status.
|
void |
setRange(long start,
long end)
Sets the optional inclusive byte range within the desired object that
will be downloaded by this request.
|
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 |
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 |
withProgressListener(ProgressListener progressListener)
Sets the optional progress listener for receiving updates about object
download status, and returns this updated object so that additional
method calls can be chained together.
|
GetObjectRequest |
withRange(long start,
long end)
Sets the optional inclusive byte range within the desired object that
will be downloaded by this request.
|
addSpecialHeader, copyPrivateRequestParameters, getAndIncrementLogSeq, getLogID, getLogSeq, getRequestClientOptions, getRequestCredentials, getToken, needSetLogInfo, setLogID, setLogSeq, setRequestCredentials, setToken
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)
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 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.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 .
start
- The start of the inclusive byte range to download.end
- The end of the inclusive byte range to download.withRange(long, long)
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 .
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 Date getModifiedSinceConstraint()
setModifiedSinceConstraint(Date)
,
withModifiedSinceConstraint(Date)
public void setModifiedSinceConstraint(Date date)
Note that 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 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 void setProgressListener(ProgressListener progressListener)
progressListener
- The new progress listener.public ProgressListener getProgressListener()
public GetObjectRequest withProgressListener(ProgressListener progressListener)
progressListener
- The new progress listener.Copyright © 2017. All Rights Reserved.