public final class DefaultTransferProgressSnapshot extends Object implements ToCopyableBuilder<DefaultTransferProgressSnapshot.Builder,DefaultTransferProgressSnapshot>, TransferProgressSnapshot
TransferProgressSnapshot.| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultTransferProgressSnapshot.Builder |
| Modifier and Type | Method and Description |
|---|---|
static DefaultTransferProgressSnapshot.Builder |
builder() |
boolean |
equals(Object o) |
int |
hashCode() |
OptionalDouble |
ratioTransferred()
The ratio of the
TransferProgressSnapshot.totalBytes() that has been transferred so far, or Optional.empty() if unknown. |
OptionalLong |
remainingBytes()
The total number of bytes that are remaining to be transferred, or
Optional.empty() if unknown. |
Optional<SdkResponse> |
sdkResponse()
The SDK response, or
Optional.empty() if unknown. |
DefaultTransferProgressSnapshot.Builder |
toBuilder() |
String |
toString() |
OptionalLong |
totalBytes()
The total size of the transfer, in bytes, or
Optional.empty() if unknown. |
long |
transferredBytes()
The total number of bytes that have been transferred so far.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcopypublic static DefaultTransferProgressSnapshot.Builder builder()
public DefaultTransferProgressSnapshot.Builder toBuilder()
toBuilder in interface ToCopyableBuilder<DefaultTransferProgressSnapshot.Builder,DefaultTransferProgressSnapshot>public long transferredBytes()
TransferProgressSnapshottransferredBytes in interface TransferProgressSnapshotpublic OptionalLong totalBytes()
TransferProgressSnapshotOptional.empty() if unknown.
In the case of file-based FileUploads, transfer sizes are known up front and immediately available. In the case of
Downloads, the transfer size is not known until S3TransferManager receives a GetObjectResponse from
Amazon S3.
totalBytes in interface TransferProgressSnapshotpublic Optional<SdkResponse> sdkResponse()
TransferProgressSnapshotOptional.empty() if unknown.
In the case of Download, the response is GetObjectResponse, and the response is known before
it starts streaming. In the case of Upload, the response is PutObjectResponse, and the response is not
known until streaming finishes.
sdkResponse in interface TransferProgressSnapshotpublic OptionalDouble ratioTransferred()
TransferProgressSnapshotTransferProgressSnapshot.totalBytes() that has been transferred so far, or Optional.empty() if unknown.
This method depends on the TransferProgressSnapshot.totalBytes() being known in order to return non-empty.
Ratio is computed as TransferProgressSnapshot.transferredBytes() / TransferProgressSnapshot.totalBytes(), where a transfer that is
half-complete would return 0.5.
ratioTransferred in interface TransferProgressSnapshotTransferProgressSnapshot.totalBytes()public OptionalLong remainingBytes()
TransferProgressSnapshotOptional.empty() if unknown. This method depends
on the TransferProgressSnapshot.totalBytes() being known in order to return non-empty.remainingBytes in interface TransferProgressSnapshotTransferProgressSnapshot.totalBytes()Copyright © 2023. All rights reserved.