类 GetObjectRequest

  • 直接已知子类:
    SetObjectSymlinkRequest

    public class GetObjectRequest
    extends GenericObjectRequest
    Provides options for downloading an Baidu Bos object.

    All GetObjectRequests must specify a bucket name and key. Beyond that, requests can also specify:

    • The range of bytes within the object to download,
    • 构造器详细资料

      • GetObjectRequest

        public GetObjectRequest()
      • GetObjectRequest

        public GetObjectRequest​(String bucketName,
                                String key)
        Constructs a new 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.
    • 方法详细资料

      • 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 null if 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