Class DefaultTransferProgressSnapshot
- java.lang.Object
-
- software.amazon.awssdk.transfer.s3.internal.progress.DefaultTransferProgressSnapshot
-
- All Implemented Interfaces:
TransferProgressSnapshot,ToCopyableBuilder<DefaultTransferProgressSnapshot.Builder,DefaultTransferProgressSnapshot>
public final class DefaultTransferProgressSnapshot extends Object implements ToCopyableBuilder<DefaultTransferProgressSnapshot.Builder,DefaultTransferProgressSnapshot>, TransferProgressSnapshot
An SDK-internal implementation ofTransferProgressSnapshot.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultTransferProgressSnapshot.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultTransferProgressSnapshot.Builderbuilder()booleanequals(Object o)inthashCode()OptionalDoubleratioTransferred()The ratio of theTransferProgressSnapshot.totalBytes()that has been transferred so far, orOptional.empty()if unknown.OptionalLongremainingBytes()The total number of bytes that are remaining to be transferred, orOptional.empty()if unknown.Optional<SdkResponse>sdkResponse()The SDK response, orOptional.empty()if unknown.DefaultTransferProgressSnapshot.BuildertoBuilder()StringtoString()OptionalLongtotalBytes()The total size of the transfer, in bytes, orOptional.empty()if unknown.longtransferredBytes()The total number of bytes that have been transferred so far.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
builder
public static DefaultTransferProgressSnapshot.Builder builder()
-
toBuilder
public DefaultTransferProgressSnapshot.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<DefaultTransferProgressSnapshot.Builder,DefaultTransferProgressSnapshot>
-
transferredBytes
public long transferredBytes()
Description copied from interface:TransferProgressSnapshotThe total number of bytes that have been transferred so far.- Specified by:
transferredBytesin interfaceTransferProgressSnapshot
-
totalBytes
public OptionalLong totalBytes()
Description copied from interface:TransferProgressSnapshotThe total size of the transfer, in bytes, orOptional.empty()if unknown.In the case of file-based
FileUploads, transfer sizes are known up front and immediately available. In the case ofDownloads, the transfer size is not known untilS3TransferManagerreceives aGetObjectResponsefrom Amazon S3.- Specified by:
totalBytesin interfaceTransferProgressSnapshot
-
sdkResponse
public Optional<SdkResponse> sdkResponse()
Description copied from interface:TransferProgressSnapshotThe SDK response, orOptional.empty()if unknown.In the case of
Download, the response isGetObjectResponse, and the response is known before it starts streaming. In the case ofUpload, the response isPutObjectResponse, and the response is not known until streaming finishes.- Specified by:
sdkResponsein interfaceTransferProgressSnapshot
-
ratioTransferred
public OptionalDouble ratioTransferred()
Description copied from interface:TransferProgressSnapshotThe ratio of theTransferProgressSnapshot.totalBytes()that has been transferred so far, orOptional.empty()if unknown. This method depends on theTransferProgressSnapshot.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 return0.5.- Specified by:
ratioTransferredin interfaceTransferProgressSnapshot- See Also:
TransferProgressSnapshot.totalBytes()
-
remainingBytes
public OptionalLong remainingBytes()
Description copied from interface:TransferProgressSnapshotThe total number of bytes that are remaining to be transferred, orOptional.empty()if unknown. This method depends on theTransferProgressSnapshot.totalBytes()being known in order to return non-empty.- Specified by:
remainingBytesin interfaceTransferProgressSnapshot- See Also:
TransferProgressSnapshot.totalBytes()
-
-