public class GetObjectRequest extends GenericObjectRequest
All GetObjectRequests must specify a bucket name and key.
Beyond that, requests can also specify:
trafficLimitBitPS| Constructor and Description |
|---|
GetObjectRequest() |
GetObjectRequest(String bucketName,
String key)
Constructs a new GetObjectRequest with all the required parameters.
|
| Modifier and Type | Method and Description |
|---|---|
BosProgressCallback |
getProgressCallback()
Gets the BosProgressCallback which used for Get object progress.
|
long[] |
getRange()
Gets the optional inclusive byte range within the desired object that will be downloaded by this request.
|
long |
getTrafficLimitBitPS()
Gets the limit of put object speed.
|
void |
setProgressCallback(BosProgressCallback progressCallback)
Sets the BosProgressCallback which used for Get object progress.
|
void |
setRange(long start,
long end)
Sets the optional inclusive byte range within the desired object that will be downloaded by this request.
|
void |
setTrafficLimitBitPS(long trafficLimitBitPS)
Sets Gets the limit of put object speed.
|
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 |
withProgressCallback(BosProgressCallback progressCallback) |
GetObjectRequest |
withRange(long start,
long end)
Sets the optional inclusive byte range within the desired object that will be downloaded by this request.
|
GetObjectRequest |
withRequestCredentials(BceCredentials credentials) |
GetObjectRequest |
withTrafficLimitBitPS(long trafficLimitBitPS) |
getKey, setKeygetBucketName, setBucketNamegetRequestCredentials, setRequestCredentialspublic GetObjectRequest withRequestCredentials(BceCredentials credentials)
withRequestCredentials in class AbstractBceRequestpublic GetObjectRequest withBucketName(String bucketName)
withBucketName in class GenericBucketRequestbucketName - The name of the bucket containing the object to be downloaded.public GetObjectRequest withKey(String key)
withKey in class GenericObjectRequestkey - The key under which the object to be downloaded is stored.public long[] getRange()
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)
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 Baidu Bos.
start - The start of the inclusive byte range to download.end - The end of the inclusive byte range to download.public GetObjectRequest withRange(long start, long end)
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 Baidu Bos.
start - The start of the inclusive byte range to download.end - The end of the inclusive byte range to download.public long getTrafficLimitBitPS()
public void setTrafficLimitBitPS(long trafficLimitBitPS)
trafficLimitBitPS - the limit of put object speed. unit: bit/spublic GetObjectRequest withTrafficLimitBitPS(long trafficLimitBitPS)
trafficLimitBitPS - the limit of put object speed. unit: bit/s, range: 819200 bit/s ~ 838860800 bit/spublic BosProgressCallback getProgressCallback()
public void setProgressCallback(BosProgressCallback progressCallback)
progressCallback - The BosProgressCallback, which used for get progress information.public GetObjectRequest withProgressCallback(BosProgressCallback progressCallback)
progressCallback - The BosProgressCallback, which used for get object information.Copyright © 2024. All rights reserved.