Difference between getContinuationToken and getNextContinuationToken in AmazonS3Client

Viewed 723

I noticed that there was a getContinuationToken method as well as getNextContinuationToken on ListObjectsV2Result. Their description Javadoc is similar in semantic:

Gets the optional continuation token. Continuation token allows a list to be continued from a specific point. ContinuationToken is provided in truncated list results.

vs

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.

On the other hand, the list request only has a setContinuationToken, but the code example from the SDK's developer guide shows that it's used by passing it the result of getNextContinuationToken. This seems pretty confusing! Does anyone have an idea of why there are two tokens and whether there's a difference between them? I couldn't find good doc about this.

Thanks!

1 Answers

getContinuationToken returns token that was used to get current result, getNextContinuationToken returns token that must be used to get next result.

Related