|
Did this page help you?Yes No Tell us about it... |
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectcom.amazonaws.services.s3.iterable.S3Versions
public class S3Versions
Provides an easy way to iterate Amazon S3 object versions in a "foreach" statement. For example:
for ( S3VersionSummary summary : S3Versions.forPrefix(s3, "my-bucket", "photos/") ) {
System.out.printf("Version '%s' of key '%s'\n", summary.getVersionId(), summary.getKey());
}
The list of S3VersionSummarys will be fetched lazily, a page at a
time, as they are needed. The size of the page can be controlled with the
withBatchSize(int) method.
| Method Summary | |
|---|---|
static S3Versions |
forKey(AmazonS3 s3,
java.lang.String bucketName,
java.lang.String key)
Constructs an iterable that covers the versions of a single Amazon S3 object. |
java.lang.Integer |
getBatchSize()
|
java.lang.String |
getBucketName()
|
java.lang.String |
getKey()
|
java.lang.String |
getPrefix()
|
AmazonS3 |
getS3()
|
static S3Versions |
inBucket(AmazonS3 s3,
java.lang.String bucketName)
Constructs an iterable that covers all the object versions in an Amazon S3 bucket. |
java.util.Iterator<S3VersionSummary> |
iterator()
|
S3Versions |
withBatchSize(int batchSize)
Sets the batch size, i.e., how many S3VersionSummarys will be fetched at
once. |
static S3Versions |
withPrefix(AmazonS3 s3,
java.lang.String bucketName,
java.lang.String prefix)
Constructs an iterable that covers the versions in an Amazon S3 bucket where the object key begins with the given prefix. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static S3Versions inBucket(AmazonS3 s3,
java.lang.String bucketName)
s3 - The Amazon S3 client.bucketName - The bucket name.
public static S3Versions withPrefix(AmazonS3 s3,
java.lang.String bucketName,
java.lang.String prefix)
s3 - The Amazon S3 client.bucketName - The bucket name.prefix - The prefix.
public static S3Versions forKey(AmazonS3 s3,
java.lang.String bucketName,
java.lang.String key)
s3 - The Amazon S3 client.bucketName - The bucket name.key - The key.
public S3Versions withBatchSize(int batchSize)
S3VersionSummarys will be fetched at
once.
batchSize - How many object summaries to fetch at once.public java.lang.Integer getBatchSize()
public java.lang.String getPrefix()
public java.lang.String getKey()
public AmazonS3 getS3()
public java.lang.String getBucketName()
public java.util.Iterator<S3VersionSummary> iterator()
iterator in interface java.lang.Iterable<S3VersionSummary>
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||