com.baidubce.services.bos.model
Class ListObjectsRequest

java.lang.Object
  extended by com.baidubce.model.AbstractBceRequest
      extended by com.baidubce.services.bos.model.GenericBucketRequest
          extended by 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.


Constructor Summary
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.
 
Method Summary
 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.
 String getMarker()
          Gets the optional marker parameter indicating where in the bucket to begin listing.
 int getMaxKeys()
          Gets the optional maxKeys parameter indicating the maximum number of keys to include in the response.
 String getPrefix()
          Gets the optional prefix parameter and restricts the response to keys that begin with the specified prefix.
 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.
 void setMarker(String marker)
          Sets the optional marker parameter indicating where in the bucket to begin listing.
 void setMaxKeys(int maxKeys)
          Sets the optional maxKeys parameter indicating the maximum number of keys to include in the response.
 void setPrefix(String prefix)
          Sets the optional prefix parameter, restricting the response to keys that begin with the specified prefix.
 ListObjectsRequest withBucketName(String bucketName)
          Sets the name of the Baidu Bos bucket whose objects are to be listed.
 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.
 ListObjectsRequest withMarker(String marker)
          Sets the optional marker parameter indicating where in the bucket to begin listing.
 ListObjectsRequest withMaxKeys(int maxKeys)
          Sets the optional maxKeys parameter indicating the maximum number of keys to include in the response.
 ListObjectsRequest withPrefix(String prefix)
          Sets the optional prefix parameter restricting the response to keys that begin with the specified prefix.
 ListObjectsRequest withRequestCredentials(BceCredentials credentials)
           
 
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

ListObjectsRequest

public ListObjectsRequest(String bucketName)
Constructs a new ListObjectsRequest object and initializes all required and optional object fields.

Parameters:
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.

Parameters:
bucketName - The name of the bucket whose objects are to be listed.
prefix - The prefix restricting what keys will be listed.
Method Detail

withRequestCredentials

public ListObjectsRequest withRequestCredentials(BceCredentials credentials)
Specified by:
withRequestCredentials in class 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.

Specified by:
withBucketName in class GenericBucketRequest
Parameters:
bucketName - The name of the Baidu Bos bucket whose objects are to be listed.
Returns:
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.

Returns:
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.

Parameters:
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.

Parameters:
prefix - 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.

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.

Returns:
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.

Parameters:
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.

Parameters:
marker - The optional parameter indicating where in the bucket to begin listing. The list will only include keys that occur lexicographically after the marker.
Returns:
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.

Returns:
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.

Parameters:
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.

Parameters:
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.
Returns:
This ListObjectsRequest, enabling additional method calls to be chained together.
See Also:
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.

Returns:
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.

Parameters:
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.

Parameters:
maxKeys - The optional parameter indicating the maximum number of keys to include in the response.
Returns:
This ListObjectsRequest, enabling additional method calls to be chained together.


Copyright © 2018. All rights reserved.