Interface Transfer
-
- All Known Subinterfaces:
Copy,Download,MultipleFileDownload,MultipleFileUpload,Upload
public interface TransferRepresents an asynchronous upload to or download from Amazon S3. Use this class to check a tranfer's progress, add listeners for progress events, check the state of a transfer, or wait for the transfer to complete.See
TransferManagerfor more information about creating transfers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTransfer.TransferStateEnumeration of the possible transfer states.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddProgressListener(ProgressListener listener)Adds the specified progress listener to the list of listeners receiving updates about this transfer's progress.voidaddProgressListener(ProgressListener listener)Deprecated.Replaced byaddProgressListener(ProgressListener)StringgetDescription()Returns a human-readable description of this transfer.TransferProgressgetProgress()Returns progress information about this transfer.Transfer.TransferStategetState()Returns the current state of this transfer.booleanisDone()Returns whether or not the transfer is finished (i.e. completed successfully, failed, or was canceled).voidremoveProgressListener(ProgressListener listener)Removes the specified progress listener from the list of progress listeners receiving updates about this transfer's progress.voidremoveProgressListener(ProgressListener listener)Deprecated.Replaced byremoveProgressListener(ProgressListener)voidwaitForCompletion()Waits for this transfer to complete.AmazonClientExceptionwaitForException()Waits for this transfer to finish and returns any error that occurred, or returnsnullif no errors occurred.
-
-
-
Method Detail
-
isDone
boolean isDone()
Returns whether or not the transfer is finished (i.e. completed successfully, failed, or was canceled).- Returns:
- Returns
trueif this transfer is finished (i.e. completed successfully, failed, or was canceled). Returnsfalseif otherwise.
-
waitForCompletion
void waitForCompletion() throws AmazonClientException, AmazonServiceException, InterruptedExceptionWaits for this transfer to complete. This is a blocking call; the current thread is suspended until this transfer completes.- Throws:
AmazonClientException- If any errors were encountered in the client while making the request or handling the response.AmazonServiceException- If any errors occurred in Amazon S3 while processing the request.InterruptedException- If this thread is interrupted while waiting for the transfer to complete.
-
waitForException
AmazonClientException waitForException() throws InterruptedException
Waits for this transfer to finish and returns any error that occurred, or returnsnullif no errors occurred. This is a blocking call; the current thread will be suspended until this transfer either fails or completes successfully.- Returns:
- Any error that occurred while processing this transfer.
Otherwise returns
nullif no errors occurred. - Throws:
InterruptedException- If this thread is interrupted while waiting for the transfer to complete.
-
getDescription
String getDescription()
Returns a human-readable description of this transfer.- Returns:
- A human-readable description of this transfer.
-
getState
Transfer.TransferState getState()
Returns the current state of this transfer.- Returns:
- The current state of this transfer.
-
addProgressListener
void addProgressListener(ProgressListener listener)
Adds the specified progress listener to the list of listeners receiving updates about this transfer's progress.- Parameters:
listener- The progress listener to add.
-
removeProgressListener
void removeProgressListener(ProgressListener listener)
Removes the specified progress listener from the list of progress listeners receiving updates about this transfer's progress.- Parameters:
listener- The progress listener to remove.
-
getProgress
TransferProgress getProgress()
Returns progress information about this transfer.- Returns:
- The progress information about this transfer.
-
addProgressListener
@Deprecated void addProgressListener(ProgressListener listener)
Deprecated.Replaced byaddProgressListener(ProgressListener)
-
removeProgressListener
@Deprecated void removeProgressListener(ProgressListener listener)
Deprecated.Replaced byremoveProgressListener(ProgressListener)
-
-