|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.AmazonWebServiceRequest
com.amazonaws.services.s3.model.ListObjectsRequest
public class ListObjectsRequest
Returns a list of summary information about the objects in the specified bucket, along with additional information depending on the request parameters (such as common prefixes if a delimiter was specified). List results are always returned in lexicographic (alphabetical) order.
Since buckets can contain a virtually unlimited number of keys, the complete
results of a list query can be extremely large. To manage large result sets,
Amazon S3 uses pagination to split them into multiple responses. Callers
should always check the ObjectListing.isTruncated()
method to see
if the returned listing is complete, or if callers need to make additional
calls to get more results. The marker parameter allows callers to specify
where to start the object listing. Alternatively, callers can use the
AmazonS3Client.listNextBatchOfObjects(ObjectListing)
method as an
easy way to get the next page of object listings.
The delimiter parameter allows groups of keys that share a prefix terminated
by a special delimiter to be rolled-up by that common prefix in the returned
listing. This allows applications to organize and browse their keys
hierarchically, much like how you would organize your files into directories
in a file system. These common prefixes can be retrieved through the
ObjectListing.getCommonPrefixes()
method.
For example, consider a bucket that contains the keys:
List performance is not substantially affected by the total number of keys in your bucket, nor by the presence or absence of any additional query parameters.
Constructor Summary | |
---|---|
ListObjectsRequest()
Constructs an empty ListObjectsRequest object. |
|
ListObjectsRequest(String bucketName,
String prefix,
String marker,
String delimiter,
Integer maxKeys)
Constructs a new ListObjectsRequest object and initializes all required and optional fields. |
Method Summary | |
---|---|
String |
getBucketName()
Returns the name of the Amazon S3 bucket whose objects are to be listed. |
String |
getDelimiter()
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 rolled up into a single result element in the ObjectListing.getCommonPrefixes() list. |
String |
getMarker()
Returns the optional parameter indicating where in the bucket to begin listing. |
Integer |
getMaxKeys()
Returns the optional parameter indicating the maximum number of keys to include in the response. |
String |
getPrefix()
Returns the optional prefix parameter restricting the response to keys which begin with the specified prefix. |
void |
setBucketName(String bucketName)
Sets the name of the Amazon S3 bucket whose objects are to be listed. |
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 rolled up into a single result element in the ObjectListing.getCommonPrefixes() list. |
void |
setMarker(String marker)
Sets the optional parameter indicating where in the bucket to begin listing. |
void |
setMaxKeys(Integer maxKeys)
Sets the optional 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 which begin with the specified prefix. |
ListObjectsRequest |
withBucketName(String bucketName)
Sets the name of the Amazon S3 bucket whose objects are to be listed, and returns this ListObjectsRequest object so that method calls can be chained together. |
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 in the ObjectListing.getCommonPrefixes() list, and returns this
ListObjectsRequest object so that method calls may be chained together. |
ListObjectsRequest |
withMarker(String marker)
Sets the optional parameter indicating where in the bucket to begin listing. |
ListObjectsRequest |
withMaxKeys(Integer maxKeys)
Sets the optional parameter indicating the maximum number of keys to include in the response, and returns this ListObjectsRequest object so that method calls may be chained together. |
ListObjectsRequest |
withPrefix(String prefix)
Sets the optional prefix parameter restricting the response to keys which begin with the specified prefix, and returns this ListObjectsRequest object so that method calls may be chained together. |
Methods inherited from class com.amazonaws.AmazonWebServiceRequest |
---|
copyPrivateRequestParameters |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListObjectsRequest()
public ListObjectsRequest(String bucketName, String prefix, String marker, String delimiter, Integer maxKeys)
bucketName
- The name of the bucket whose objects are to be listed.prefix
- The prefix restricting what keys will be listed.marker
- The key marker indicating where results should begin.delimiter
- The delimiter for condensing common prefixes in returned
results.maxKeys
- The maximum number of results to return.Method Detail |
---|
public String getBucketName()
public void setBucketName(String bucketName)
bucketName
- The name of the Amazon S3 bucket whose objects are to be
listed.public ListObjectsRequest withBucketName(String bucketName)
bucketName
- The name of the Amazon S3 bucket whose objects are to be
listed.
public String getPrefix()
public void setPrefix(String prefix)
prefix
- the optional prefix parameter restricting the response to keys
which begin with the specified prefix.public ListObjectsRequest withPrefix(String prefix)
prefix
- the optional prefix parameter restricting the response to keys
which begin with the specified prefix.
public String getMarker()
public void setMarker(String 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.public ListObjectsRequest withMarker(String 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.
public String getDelimiter()
ObjectListing.getCommonPrefixes()
list. These rolled-up 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.
ObjectListing.getCommonPrefixes()
list.public void setDelimiter(String delimiter)
ObjectListing.getCommonPrefixes()
list.
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 in
the ObjectListing.getCommonPrefixes()
list.public ListObjectsRequest withDelimiter(String delimiter)
ObjectListing.getCommonPrefixes()
list, and returns this
ListObjectsRequest object so that method calls may 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 in
the ObjectListing.getCommonPrefixes()
list.
public Integer getMaxKeys()
public void setMaxKeys(Integer maxKeys)
maxKeys
- the optional parameter indicating the maximum number of keys
to include in the response.public ListObjectsRequest withMaxKeys(Integer maxKeys)
maxKeys
- the optional parameter indicating the maximum number of keys
to include in the response.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |