Interface TransferProgress
-
- All Known Implementing Classes:
DefaultTransferProgress,ResumeTransferProgress
@Mutable @ThreadSafe public interface TransferProgress
TransferProgressis a stateful representation of the progress of a transfer initiated byS3TransferManager.TransferProgressoffers the ability to take asnapshot()of the current progress, represented by an immutableTransferProgressSnapshot, which contains helpful progress-related methods likeTransferProgressSnapshot.transferredBytes()andTransferProgressSnapshot.ratioTransferred().TransferProgressis attached toObjectTransferobjects, namelyUpload,Download, andCopy.Where possible, it is typically recommended to avoid directly querying
TransferProgressand to instead leverage theTransferListenerinterface to receive event-driven updates of the latestTransferProgressSnapshot. See theTransferListenerdocumentation for usage instructions. However, if desired,TransferProgresscan be used for poll-like checking of the current progress. E.g.,Upload upload = tm.upload(...); while (!upload.completionFuture().isDone()) { upload.progress().snapshot().ratioTransferred().ifPresent(System.out::println); Thread.sleep(1000); }
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TransferProgressSnapshotsnapshot()Takes a snapshot of the current progress, represented by an immutableTransferProgressSnapshot.
-
-
-
Method Detail
-
snapshot
TransferProgressSnapshot snapshot()
Takes a snapshot of the current progress, represented by an immutableTransferProgressSnapshot.
-
-