| インタフェース | 説明 |
|---|---|
| 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.
|
| ObjectMetadataProvider |
This is the callback interface which is used by TransferManager.uploadDirectory and
TransferManager.uploadFileList.
|
| Transfer |
Represents an asynchronous upload to or download from Amazon S3.
|
| Upload |
Represents an asynchronous upload to Amazon S3.
|
| クラス | 説明 |
|---|---|
| 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.
|
| 列挙型 | 説明 |
|---|---|
| Transfer.TransferState |
Enumeration of the possible transfer states.
|
このパッケージには、非同期伝送に使うキューを管理する、
TransferManagerクラスがあります。
呼び出し元では、TransferManagerのインスタンスをひとつ生成し、これをアプリケーション全体で共用します。
アップロード処理が発生したとき、これをTransferManagerのキューに入れれば、
あとは別の処理を続けて構いません。
TransferManagerはその間、非同期アップロード処理の進捗を追跡しています。
TransferManagerには次のような利点があります。
Java用AWS SDKに付属する「AmazonS3TransferProgress」は、 TransferManagerの使い方、アップロード処理の進捗を追跡する方法を示すコード例になっています。
TransferManagerを使ってデータをAmazon S3にアップロードする処理は、次のように簡単に記述できます。
AWSCredentials myCredentials = new BasicAWSCredentials(...);
TransferManager tx = new TransferManager(myCredentials);
Upload myUpload = tx.upload(myBucket, myFile.getName(), myFile);
// You can poll your transfer's status to check its progress
if (myUpload.isDone() == false) {
System.out.println("Transfer: " + myUpload.getDescription());
System.out.println(" - State: " + myUpload.getState());
System.out.println(" - Progress: " + myUpload.getProgress().getBytesTransferred());
}
// Transfers also allow you to set a ProgressListener to receive
// asynchronous notifications about your transfer's progress.
myUpload.addProgressListener(myProgressListener);
// Or you can block the current thread and wait for your transfer to
// to complete. If the transfer fails, this method will throw an
// AmazonClientException or AmazonServiceException detailing the reason.
myUpload.waitForCompletion();
TransferManager