类 ListObjectsRequest
- java.lang.Object
-
- com.baidubce.model.AbstractBceRequest
-
- com.baidubce.services.bos.model.GenericBucketRequest
-
- com.baidubce.services.bos.model.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(String bucketName)Constructs a new ListObjectsRequest object and initializes all required and optional object fields.ListObjectsRequest(String bucketName, String prefix)Constructs a new ListObjectsRequest object and initializes all required and optional object fields.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 StringgetDelimiter()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.StringgetMarker()Gets the optional marker parameter indicating where in the bucket to begin listing.intgetMaxKeys()Gets the optionalmaxKeysparameter indicating the maximum number of keys to include in the response.StringgetPrefix()Gets the optional prefix parameter and restricts the response to keys that begin with the specified prefix.voidsetDelimiter(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.voidsetMarker(String marker)Sets the optional marker parameter indicating where in the bucket to begin listing.voidsetMaxKeys(int maxKeys)Sets the optionalmaxKeysparameter indicating the maximum number of keys to include in the response.voidsetPrefix(String prefix)Sets the optional prefix parameter, restricting the response to keys that begin with the specified prefix.ListObjectsRequestwithBucketName(String bucketName)Sets the name of the Baidu Bos bucket whose objects are to be listed.ListObjectsRequestwithDelimiter(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.ListObjectsRequestwithMarker(String marker)Sets the optional marker parameter indicating where in the bucket to begin listing.ListObjectsRequestwithMaxKeys(int maxKeys)Sets the optionalmaxKeysparameter indicating the maximum number of keys to include in the response.ListObjectsRequestwithPrefix(String prefix)Sets the optional prefix parameter restricting the response to keys that begin with the specified prefix.ListObjectsRequestwithRequestCredentials(BceCredentials credentials)-
从类继承的方法 com.baidubce.services.bos.model.GenericBucketRequest
getBucketName, setBucketName
-
从类继承的方法 com.baidubce.model.AbstractBceRequest
getRequestCredentials, setRequestCredentials
-
-
-
-
构造器详细资料
-
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.
-
-
方法详细资料
-
withRequestCredentials
public ListObjectsRequest withRequestCredentials(BceCredentials credentials)
- 指定者:
withRequestCredentials在类中AbstractBceRequest
-
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 optionalmaxKeysparameter 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 optionalmaxKeysparameter 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 optionalmaxKeysparameter 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.
-
-