Class ListObjectsV2Result
- java.lang.Object
-
- com.amazonaws.services.s3.model.ListObjectsV2Result
-
- All Implemented Interfaces:
Serializable
public class ListObjectsV2Result extends Object implements Serializable
Results of a listing of objects from an S3 bucket.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ListObjectsV2Result()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBucketName()
Gets the name of the Amazon S3 bucket containing the objects listed in thisListObjectsV2Result
.List<String>
getCommonPrefixes()
Gets the common prefixes included in this object listing.String
getContinuationToken()
Gets the optional continuation token.String
getDelimiter()
Gets the delimiter parameter originally used to request this object listing, ornull
if no delimiter specified.String
getEncodingType()
Gets the encoding type used by Amazon S3 to encode object key names in the XML response.int
getKeyCount()
Gets the number of keys returned with this response.int
getMaxKeys()
Gets the optionalmaxKeys
parameter indicating the maximum number of keys to include in the response.String
getNextContinuationToken()
Gets the optional NextContinuationToken.List<S3ObjectSummary>
getObjectSummaries()
Gets the list of object summaries describing the objects stored in the S3 bucket.String
getPrefix()
Gets the prefix parameter originally used to request this object listing, ornull
if no prefix was specified.String
getStartAfter()
Returns optional parameter indicating where you want Amazon S3 to start the object listing from.boolean
isTruncated()
Gets whether or not this object listing is complete.void
setBucketName(String bucketName)
For internal use only.void
setCommonPrefixes(List<String> commonPrefixes)
For internal use only.void
setContinuationToken(String continuationToken)
Sets the optional continuation token.void
setDelimiter(String delimiter)
For internal use only.void
setEncodingType(String encodingType)
For internal use only.void
setKeyCount(int keyCount)
Sets the number of keys returned with this response.void
setMaxKeys(int maxKeys)
Sets the optionalmaxKeys
parameter indicating the maximum number of keys to include in the response.void
setNextContinuationToken(String nextContinuationToken)
Sets the optional NextContinuationToken.void
setPrefix(String prefix)
For internal use only.void
setStartAfter(String startAfter)
Sets the optional parameter indicating where you want Amazon S3 to start the object listing from.void
setTruncated(boolean isTruncated)
For internal use only.
-
-
-
Method Detail
-
isTruncated
public boolean isTruncated()
Gets whether or not this object listing is complete.- Returns:
- The value
true
if the object listing is not complete. Returns the valuefalse
if otherwise. When returningtrue
, additional calls to Amazon S3 may be needed in order to obtain more results.
-
setTruncated
public void setTruncated(boolean isTruncated)
For internal use only. Sets the truncated property for this object listing, indicating if this is a complete listing or not and whether the caller needs to make additional calls to S3 to get more object summaries.- Parameters:
isTruncated
- The valuetrue
if the object listing is not complete. The valuefalse
if otherwise.
-
getBucketName
public String getBucketName()
Gets the name of the Amazon S3 bucket containing the objects listed in thisListObjectsV2Result
.- Returns:
- The name of the Amazon S3 bucket containing the objects listed in
this
ListObjectsV2Result
.
-
setBucketName
public void setBucketName(String bucketName)
For internal use only. Sets the name of the Amazon S3 bucket containing the objects listed in thisListObjectsV2Result
.- Parameters:
bucketName
- The name of the Amazon S3 bucket containing the objects listed in thisListObjectsV2Result
.
-
getPrefix
public String getPrefix()
Gets the prefix parameter originally used to request this object listing, ornull
if no prefix was specified. All objects and common prefixes included in this object listing start with the specified prefix.- Returns:
- The prefix parameter originally used to request this object
listing. Returns
null
if no prefix was specified.
-
setPrefix
public void setPrefix(String prefix)
For internal use only. Sets the prefix parameter originally used to request this object listing.- Parameters:
prefix
- The prefix parameter originally used to request this object listing.
-
getDelimiter
public String getDelimiter()
Gets the delimiter parameter originally used to request this object listing, ornull
if no delimiter specified.The delimiter value allows callers to condense S3 keys into common prefix listings. For example, if a caller specifies a delimiter of "/" (a common used value for delimiter), any keys that contain a common prefix between the start of the key and the first occurrence of "/" will not be included in the list of object summaries. Instead, the common prefixes list will have one entry for the common prefix.
- Returns:
- The delimiter parameter originally used to request this object
listing. Returns
null
if no delimiter was specified.
-
setDelimiter
public void setDelimiter(String delimiter)
For internal use only. Sets the delimiter parameter originally used to request this object listing.- Parameters:
delimiter
- The delimiter parameter originally used to request this object listing.
-
getEncodingType
public String getEncodingType()
Gets the encoding type used by Amazon S3 to encode object key names in the XML response. If you specifyencodingType
request parameter, Amazon S3 includes this element in the response, and returns encoded key name values in the following response elements:Delimiter, Marker, Prefix, NextMarker, Key
.- Returns:
Null
ifencodingType
is not specified in the request parameter.
-
setEncodingType
public void setEncodingType(String encodingType)
For internal use only. Sets the encoding type used by Amazon S3 to encode object key names in the XML response.- Parameters:
encodingType
-Null
ifencodingType
is not specified in the request parameter.
-
getContinuationToken
public String getContinuationToken()
Gets the optional continuation token. Continuation token allows a list to be continued from a specific point. ContinuationToken is provided in truncated list results.- Returns:
- The optional continuation token associated with this request.
-
setContinuationToken
public void setContinuationToken(String continuationToken)
Sets the optional continuation token. Continuation token allows a list to be continued from a specific point. ContinuationToken is provided in truncated list results.- Parameters:
continuationToken
- The optional continuation token to associate with this request.
-
getNextContinuationToken
public String getNextContinuationToken()
Gets the optional NextContinuationToken. NextContinuationToken is sent when isTruncated is true meaning there are more keys in the bucket that can be listed. The next list requests to Amazon S3 can be continued by providing this NextContinuationToken.- Returns:
- The optional NextContinuationToken parameter.
-
setNextContinuationToken
public void setNextContinuationToken(String nextContinuationToken)
Sets the optional NextContinuationToken. NextContinuationToken is sent when isTruncated is true meaning there are more keys in the bucket that can be listed. The next list requests to Amazon S3 can be continued by providing this NextContinuationToken.- Parameters:
nextContinuationToken
- The optional NextContinuationToken parameter to associate with this request.
-
getKeyCount
public int getKeyCount()
Gets the number of keys returned with this response.- Returns:
- number of keys returned with this response.
-
setKeyCount
public void setKeyCount(int keyCount)
Sets the number of keys returned with this response.- Parameters:
keyCount
- The number of keys that were returned with this response.
-
getMaxKeys
public int getMaxKeys()
Gets the optionalmaxKeys
parameter indicating the maximum number of keys to include in the response. Amazon S3 might return fewer keys than specified, but will never return more. Even if the optional parameter is not specified, Amazon S3 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 optionalmaxKeys
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.
-
getStartAfter
public String getStartAfter()
Returns optional parameter indicating where you want Amazon S3 to start the object listing from. This can be any key in the bucket.- Returns:
- the optional startAfter parameter
-
setStartAfter
public void setStartAfter(String startAfter)
Sets the optional parameter indicating where you want Amazon S3 to start the object listing from. This can be any key in the bucket.- Parameters:
startAfter
- The optional startAfter parameter. This can be any key in the bucket.
-
getObjectSummaries
public List<S3ObjectSummary> getObjectSummaries()
Gets the list of object summaries describing the objects stored in the S3 bucket. Listings for large buckets can be truncated for performance reasons. Always check theisTruncated()
method to see if the returned listing is complete or if additional calls are needed to get more results. Callers can pass the nextContinuationToken into subsequent requests to get additional results.- Returns:
- A list of the object summaries describing the objects stored in the S3 bucket.
-
getCommonPrefixes
public List<String> getCommonPrefixes()
Gets the common prefixes included in this object listing. Common prefixes are only present if a delimiter was specified in the original request.
Each common prefix represents a set of keys in the S3 bucket that have been condensed and omitted from the object summary results. This allows applications to organize and browse their keys hierarchically, similar to how a file system organizes files into directories.
For example, consider a bucket that contains the following keys:
- "foo/bar/baz"
- "foo/bar/bash"
- "foo/bar/bang"
- "foo/boo"
listObjects
with the prefix="foo/" and the delimiter="/" on this bucket, the returnedS3ObjectListing
will contain one entry in the common prefixes list ("foo/bar/") and none of the keys beginning with that common prefix will be included in the object summaries list.- Returns:
- The list of common prefixes included in this object listing, which might be an empty list if no common prefixes were found.
-
setCommonPrefixes
public void setCommonPrefixes(List<String> commonPrefixes)
For internal use only. Sets the common prefixes for this object listing, representing the key prefixes that were rolled up because of the request's delimiter parameter.- Parameters:
commonPrefixes
- The common prefixes for this object listing.
-
-