类 ListObjectsRequest


  • public class ListObjectsRequest
    extends GenericBucketRequest
    Contains options to return a list of summary information about the objects in the specified bucket. Depending on the request parameters, additional information is returned, such as common prefixes if a delimiter was specified. List results are always returned in lexicographic (alphabetical) order.
    • 构造器详细资料

      • ListObjectsRequest

        public ListObjectsRequest​(String bucketName)
        Constructs a new ListObjectsRequest object and initializes all required and optional object fields.
        参数:
        bucketName - The name of the bucket whose objects are to be listed.
      • ListObjectsRequest

        public ListObjectsRequest​(String bucketName,
                                  String prefix)
        Constructs a new ListObjectsRequest object and initializes all required and optional object fields.
        参数:
        bucketName - The name of the bucket whose objects are to be listed.
        prefix - The prefix restricting what keys will be listed.
    • 方法详细资料

      • withBucketName

        public ListObjectsRequest withBucketName​(String bucketName)
        Sets the name of the Baidu Bos bucket whose objects are to be listed. Returns this ListObjectsRequest, enabling additional method calls to be chained together.
        指定者:
        withBucketName 在类中 GenericBucketRequest
        参数:
        bucketName - The name of the Baidu Bos bucket whose objects are to be listed.
        返回:
        This ListObjectsRequest, enabling additional method calls to be chained together.
      • getPrefix

        public String getPrefix()
        Gets the optional prefix parameter and restricts the response to keys that begin with the specified prefix. Use prefixes to separate a bucket into different sets of keys, similar to how a file system organizes files into directories.
        返回:
        The optional prefix parameter restricting the response to keys that begin with the specified prefix.
      • setPrefix

        public void setPrefix​(String prefix)
        Sets the optional prefix parameter, restricting the response to keys that begin with the specified prefix.
        参数:
        prefix - The optional prefix parameter, restricting the response to keys that begin with the specified prefix.
      • withPrefix

        public ListObjectsRequest withPrefix​(String prefix)
        Sets the optional prefix parameter restricting the response to keys that begin with the specified prefix. Returns this ListObjectsRequest, enabling additional method calls to be chained together.
        参数:
        prefix - The optional prefix parameter restricting the response to keys that begin with the specified prefix.
        返回:
        This ListObjectsRequest, enabling additional method calls to be chained together.
      • getMarker

        public String getMarker()
        Gets the optional marker parameter indicating where in the bucket to begin listing. The list will only include keys that occur lexicographically after the marker.
        返回:
        The optional marker parameter indicating where in the bucket to begin listing. The list will only include keys that occur lexicographically after the marker.
      • setMarker

        public void setMarker​(String marker)
        Sets the optional marker parameter indicating where in the bucket to begin listing. The list will only include keys that occur lexicographically after the marker.
        参数:
        marker - The optional marker parameter indicating where in the bucket to begin listing. The list will only include keys that occur lexicographically after the marker.
      • withMarker

        public ListObjectsRequest withMarker​(String marker)
        Sets the optional marker parameter indicating where in the bucket to begin listing. Returns this ListObjectsRequest, enabling additional method calls to be chained together. The list will only include keys that occur lexicographically after the marker.
        参数:
        marker - The optional parameter indicating where in the bucket to begin listing. The list will only include keys that occur lexicographically after the marker.
        返回:
        This ListObjectsRequest, enabling additional method calls to be chained together.
      • getDelimiter

        public String getDelimiter()
        Gets the optional delimiter parameter that causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be combined into a single result element. These combined keys are not returned elsewhere in the response. The most commonly used delimiter is "/", which simulates a hierarchical organization similar to a file system directory structure.
        返回:
        The optional delimiter parameter that causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be combined into a single result element.
      • setDelimiter

        public void setDelimiter​(String delimiter)
        Sets the optional delimiter parameter that causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be combined into a single result element.
        参数:
        delimiter - The optional delimiter parameter that causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be combined into a single result element.
      • withDelimiter

        public ListObjectsRequest withDelimiter​(String delimiter)
        Sets the optional delimiter parameter that causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element. Returns this ListObjectsRequest, enabling additional method calls to be chained together.
        参数:
        delimiter - The optional delimiter parameter that causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element.
        返回:
        This ListObjectsRequest, enabling additional method calls to be chained together.
        另请参阅:
        getDelimiter(), setDelimiter(String)
      • getMaxKeys

        public int getMaxKeys()
        Gets the optional maxKeys parameter indicating the maximum number of keys to include in the response. Baidu Bos might return fewer keys than specified, but will never return more. Even if the optional parameter is not specified, Baidu Bos will limit the number of results in the response.
        返回:
        The optional parameter indicating the maximum number of keys to include in the response.
      • setMaxKeys

        public void setMaxKeys​(int maxKeys)
        Sets the optional maxKeys parameter indicating the maximum number of keys to include in the response.
        参数:
        maxKeys - The optional parameter indicating the maximum number of keys to include in the response.
      • withMaxKeys

        public ListObjectsRequest withMaxKeys​(int maxKeys)
        Sets the optional maxKeys parameter indicating the maximum number of keys to include in the response. Returns this ListObjectsRequest, enabling additional method calls to be chained together.
        参数:
        maxKeys - The optional parameter indicating the maximum number of keys to include in the response.
        返回:
        This ListObjectsRequest, enabling additional method calls to be chained together.