public class S3Downloader extends BaseS3
ACCESS_KEY, ACCESS_SECRET, accessKey, AWS_ACCESS_KEY, AWS_SECRET_KEY, creds, secretKey, serialVersionUID
Constructor and Description |
---|
S3Downloader() |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
buckets()
Returns the list of buckets in s3
|
void |
download(java.lang.String bucket,
java.lang.String key,
java.io.File to) |
void |
download(java.lang.String bucket,
java.lang.String key,
java.io.OutputStream to) |
com.amazonaws.services.s3.transfer.MultipleFileDownload |
downloadFolder(java.lang.String bucketName,
java.lang.String keyPrefix,
java.io.File folderPath) |
java.util.Iterator<java.io.InputStream> |
iterateBucket(java.lang.String bucket)
Iterate over individual buckets.
|
java.util.List<java.lang.String> |
keysForBucket(java.lang.String bucket)
Return the keys for a bucket
|
com.amazonaws.services.s3.model.ObjectListing |
listObjects(java.lang.String bucket)
Simple way of retrieving the listings for a bucket
|
com.amazonaws.services.s3.model.ObjectListing |
nextList(com.amazonaws.services.s3.model.ObjectListing list)
Iterator style one list at a time
|
java.io.InputStream |
objectForKey(java.lang.String bucket,
java.lang.String key)
Returns an input stream for the given bucket and key
|
void |
paginate(java.lang.String bucket,
BucketKeyListener listener)
Paginates through a bucket's keys invoking the listener
at each key
|
public java.util.List<java.lang.String> keysForBucket(java.lang.String bucket)
bucket
- the bucket to get the keys forpublic java.util.List<java.lang.String> buckets()
public java.util.Iterator<java.io.InputStream> iterateBucket(java.lang.String bucket)
bucket
- the bucket to iterate overpublic com.amazonaws.services.s3.model.ObjectListing nextList(com.amazonaws.services.s3.model.ObjectListing list)
list
- the list to getFromOrigin the next batch forpublic com.amazonaws.services.s3.model.ObjectListing listObjects(java.lang.String bucket)
bucket
- the bucket to retrieve listings forpublic void paginate(java.lang.String bucket, BucketKeyListener listener)
bucket
- the bucket to iteratelistener
- the listenerpublic java.io.InputStream objectForKey(java.lang.String bucket, java.lang.String key)
bucket
- the bucket to retrieve fromkey
- the key of the objec tpublic void download(java.lang.String bucket, java.lang.String key, java.io.File to) throws java.io.IOException
java.io.IOException
public void download(java.lang.String bucket, java.lang.String key, java.io.OutputStream to) throws java.io.IOException
java.io.IOException
public com.amazonaws.services.s3.transfer.MultipleFileDownload downloadFolder(java.lang.String bucketName, java.lang.String keyPrefix, java.io.File folderPath)