javaamazon-web-servicesamazon-s3downloadawss3transfermanager

AWS S3 Download Pause Method Does Not Work Properly


I am trying to implement implement pause and resume mechanism for Amazon S3 SDK.

I am using TransferManager to start download and to resume it like the given example in the link

There is a problem with downloadInstance.pause() method.

It does not pause the download like in the uploadInstance.tryPause(true)

I have attached ProgressListener to downloadInstance like following:

TransferProgress progress = myDownload.getProgress();

I have tried to pause progress like following:

PersistableDownload persistableDownload = myDownload.pause();

After this point I have checked progress instance and see the progress changed in debug. So I can say that it is not pausing download operation as intended.

To resume the download from the persistableDownload instance, I have tried the following:

Download resumedDownload = transferManager.resumeDownload(persistableDownload);

I have also attached different TransferProgress instance to resumeDownload instance and I have seen that it is starting from beginning instead of resuming.


Solution

  • I have found the root cause of the problem. S3 is allowing parallel downloads as default and it is not possible to resume download if it is parallel downloaded as parts.