类 GetObjectRequest
- java.lang.Object
-
- com.baidubce.model.AbstractBceRequest
-
- com.baidubce.services.bos.model.GenericBucketRequest
-
- com.baidubce.services.bos.model.GenericObjectRequest
-
- com.baidubce.services.bos.model.GetObjectRequest
-
- 直接已知子类:
SetObjectSymlinkRequest
public class GetObjectRequest extends GenericObjectRequest
Provides options for downloading an Baidu Bos object.All
GetObjectRequestsmust specify a bucket name and key. Beyond that, requests can also specify:- The range of bytes within the object to download,
-
-
字段概要
-
从类继承的字段 com.baidubce.services.bos.model.GenericObjectRequest
trafficLimitBitPS
-
-
构造器概要
构造器 构造器 说明 GetObjectRequest()GetObjectRequest(String bucketName, String key)Constructs a new GetObjectRequest with all the required parameters.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 long[]getRange()Gets the optional inclusive byte range within the desired object that will be downloaded by this request.longgetTrafficLimitBitPS()Gets the limit of put object speed.voidsetRange(long start, long end)Sets the optional inclusive byte range within the desired object that will be downloaded by this request.voidsetTrafficLimitBitPS(long trafficLimitBitPS)Sets Gets the limit of put object speed.GetObjectRequestwithBucketName(String bucketName)Sets the name of the bucket containing the object to be downloaded.GetObjectRequestwithKey(String key)Sets the key under which the object to be downloaded is stored.GetObjectRequestwithRange(long start, long end)Sets the optional inclusive byte range within the desired object that will be downloaded by this request.GetObjectRequestwithRequestCredentials(BceCredentials credentials)GetObjectRequestwithTrafficLimitBitPS(long trafficLimitBitPS)-
从类继承的方法 com.baidubce.services.bos.model.GenericObjectRequest
getKey, setKey
-
从类继承的方法 com.baidubce.services.bos.model.GenericBucketRequest
getBucketName, setBucketName
-
从类继承的方法 com.baidubce.model.AbstractBceRequest
getRequestCredentials, setRequestCredentials
-
-
-
-
方法详细资料
-
withRequestCredentials
public GetObjectRequest withRequestCredentials(BceCredentials credentials)
- 指定者:
withRequestCredentials在类中AbstractBceRequest
-
withBucketName
public GetObjectRequest withBucketName(String bucketName)
Sets the name of the bucket containing the object to be downloaded. Returns this GetObjectRequest, enabling additional method calls to be chained together.- 指定者:
withBucketName在类中GenericBucketRequest- 参数:
bucketName- The name of the bucket containing the object to be downloaded.- 返回:
- This GetObjectRequest, enabling additional method calls to be chained together.
-
withKey
public GetObjectRequest withKey(String key)
Sets the key under which the object to be downloaded is stored. Returns this GetObjectRequest, enabling additional method calls to be chained together.- 指定者:
withKey在类中GenericObjectRequest- 参数:
key- The key under which the object to be downloaded is stored.- 返回:
- This GetObjectRequest, enabling additional method calls to be chained together.
-
getRange
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.- 返回:
- A two element array indicating the inclusive start index and end index
within the object being downloaded by this request.
Returns
nullif no range has been specified, and the whole object is to be downloaded.
-
setRange
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 Baidu Bos.
- 参数:
start- The start of the inclusive byte range to download.end- The end of the inclusive byte range to download.
-
withRange
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 Baidu Bos.
- 参数:
start- The start of the inclusive byte range to download.end- The end of the inclusive byte range to download.- 返回:
- This GetObjectRequest, enabling additional method calls to be chained together.
-
getTrafficLimitBitPS
public long getTrafficLimitBitPS()
Gets the limit of put object speed.- 返回:
- the limit of put object speed. unit: bit/s
-
setTrafficLimitBitPS
public void setTrafficLimitBitPS(long trafficLimitBitPS)
Sets Gets the limit of put object speed. range: 819200 bit/s ~ 838860800 bit/s- 参数:
trafficLimitBitPS- the limit of put object speed. unit: bit/s
-
withTrafficLimitBitPS
public GetObjectRequest withTrafficLimitBitPS(long trafficLimitBitPS)
- 参数:
trafficLimitBitPS- the limit of put object speed. unit: bit/s, range: 819200 bit/s ~ 838860800 bit/s- 返回:
- This PutObjectRequest, so that additional method calls can be chained together
-
-