|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.baidubce.model.AbstractBceRequest
com.baidubce.services.bos.model.GenericBucketRequest
com.baidubce.services.bos.model.GenericObjectRequest
com.baidubce.services.bos.model.GetObjectRequest
public class GetObjectRequest
Provides options for downloading an Baidu Bos object.
All GetObjectRequests
must specify a bucket name and key.
Beyond that, requests can also specify:
Constructor Summary | |
---|---|
GetObjectRequest()
|
|
GetObjectRequest(String bucketName,
String key)
Constructs a new GetObjectRequest with all the required parameters. |
Method Summary | |
---|---|
long[] |
getRange()
Gets the optional inclusive byte range within the desired object that will be downloaded by this request. |
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 |
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)
|
Methods inherited from class com.baidubce.services.bos.model.GenericObjectRequest |
---|
getKey, setKey |
Methods inherited from class com.baidubce.services.bos.model.GenericBucketRequest |
---|
getBucketName, setBucketName |
Methods inherited from class com.baidubce.model.AbstractBceRequest |
---|
getRequestCredentials, setRequestCredentials |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GetObjectRequest()
public GetObjectRequest(String bucketName, String key)
bucketName
- The name of the bucket containing the desired object.key
- The key in the specified bucket under which the object is stored.Method Detail |
---|
public GetObjectRequest withRequestCredentials(BceCredentials credentials)
withRequestCredentials
in class AbstractBceRequest
public GetObjectRequest withBucketName(String bucketName)
withBucketName
in class GenericBucketRequest
bucketName
- The name of the bucket containing the object to be downloaded.
public GetObjectRequest withKey(String key)
withKey
in class GenericObjectRequest
key
- 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |