Java Code Examples for com.amazonaws.services.s3.transfer.Transfer.TransferState#Completed

The following examples show how to use com.amazonaws.services.s3.transfer.Transfer.TransferState#Completed . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: S3S3Copier.java    From circus-train with Apache License 2.0 5 votes vote down vote up
@Override
public void transferStateChanged(Transfer transfer, TransferState state) {
  if (state == TransferState.Completed) {
    // NOTE: running progress doesn't seem to be reported correctly.
    // transfer.getProgress().getBytesTransferred() is always 0. Unsure what is the cause of this at this moment
    // so just printing total bytes when completed.
    LOG
        .debug("copied object from '{}/{}' to '{}/{}': {} bytes transferred", s3ObjectSummary.getBucketName(),
            s3ObjectSummary.getKey(), targetS3Uri.getBucket(), targetKey,
            transfer.getProgress().getTotalBytesToTransfer());
  }
}