|
|||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
---|---|
Download | Represents an asynchronous download from Amazon S3. |
MultipleFileDownload | Multiple file download of an entire virtual directory. |
MultipleFileUpload | Multiple file download of an entire virtual directory. |
Transfer | Represents an asynchronous upload to or download from Amazon S3. |
Upload | Represents an asynchronous upload to Amazon S3. |
Class Summary | |
---|---|
TransferManager | High level utility for managing transfers to Amazon S3. |
TransferManagerConfiguration | Configuration options for how TransferManager processes requests. |
TransferProgress | Describes the progress of a transfer. |
Enum Summary | |
---|---|
Transfer.TransferState | Enumeration of the possible transfer states. |
Transfer management.
This package provides the TransferManager
class, which
manages a queue of asynchronous transfers. Callers can create a TransferManager instance, sharing
that same instance throughout their application, queue new uploads for TransferManager to process,
and continue working while TransferManager tracks the asynchronous upload progress.
The main benefits of using TransferManager are:
The AmazonS3TransferProgress sample included in the AWS SDK for Java demonstrates how to use TransferManager and how to track progress for uploads.
Using TransferManager to upload data to Amazon S3 is easy:
AWSCredentials myCredentials = new BasicAWSCredentials(...); TransferManager tm = new TransferManager(myCredentials); Transfer myUpload = tm.upload(myBucket, myFile.getName(), myFile); // You can keep doing work while the transfer uploads in a background thread while (myUpload.isDone() == false) { System.out.println("Transfer: " + myUpload.getDescription()); System.out.println(" - State: " + myUpload.getState()); System.out.println(" - Progress: " + myUpload.getProgress().getBytesTransfered()); // Do work while we wait for our upload to complete... Thread.sleep(500); } // Or you can wait for the transfer to finish if you don't need to do more work myUpload.waitForCompletion();
TransferManager
|
|||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |