Class ResumableFileDownload
- java.lang.Object
-
- software.amazon.awssdk.transfer.s3.model.ResumableFileDownload
-
- All Implemented Interfaces:
ResumableTransfer,ToCopyableBuilder<ResumableFileDownload.Builder,ResumableFileDownload>
public final class ResumableFileDownload extends Object implements ResumableTransfer, ToCopyableBuilder<ResumableFileDownload.Builder,ResumableFileDownload>
An opaque token that holds the state and can be used to resume a paused download operation.Serialization: When serializing this token, the following structures will not be preserved/persisted:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceResumableFileDownload.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ResumableFileDownload.Builderbuilder()longbytesTransferred()Retrieve the number of bytes that have been transferred.List<Integer>completedParts()The lists of parts that were successfully completed and saved to the file.DownloadFileRequestdownloadFileRequest()booleanequals(Object o)InstantfileLastModified()Last modified time of the file since last pausestatic ResumableFileDownloadfromBytes(SdkBytes bytes)Deserialize bytes with JSON data into aResumableFileDownload.static ResumableFileDownloadfromFile(Path path)Deserialize data at the given path into aResumableFileDownload.static ResumableFileDownloadfromString(String contents)Deserialize a string with JSON data into aResumableFileDownload.inthashCode()Optional<String>s3ObjectEtag()Etag of the S3 object since last pause, orOptional.empty()if unknownOptional<Instant>s3ObjectLastModified()Last modified time of the S3 object since last pause, orOptional.empty()if unknownSdkBytesserializeToBytes()Returns the serialized JSON data representing this object as anSdkBytesobject.voidserializeToFile(Path path)Persists this download object to a file in Base64-encoded JSON format.InputStreamserializeToInputStream()Returns the serialized JSON data representing this object as anInputStream.voidserializeToOutputStream(OutputStream outputStream)Writes the serialized JSON data representing this object to an output stream.StringserializeToString()Returns the serialized JSON data representing this object as a string.ResumableFileDownload.BuildertoBuilder()StringtoString()OptionalLongtotalSizeInBytes()The total size of the transfer in bytes orOptionalLong.empty()if unknown-
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 ResumableFileDownload.Builder builder()
-
downloadFileRequest
public DownloadFileRequest downloadFileRequest()
- Returns:
- the
DownloadFileRequestto resume
-
bytesTransferred
public long bytesTransferred()
Retrieve the number of bytes that have been transferred.- Returns:
- the number of bytes
-
s3ObjectLastModified
public Optional<Instant> s3ObjectLastModified()
Last modified time of the S3 object since last pause, orOptional.empty()if unknown
-
s3ObjectEtag
public Optional<String> s3ObjectEtag()
Etag of the S3 object since last pause, orOptional.empty()if unknown
-
fileLastModified
public Instant fileLastModified()
Last modified time of the file since last pause
-
totalSizeInBytes
public OptionalLong totalSizeInBytes()
The total size of the transfer in bytes orOptionalLong.empty()if unknown- Returns:
- the optional total size of the transfer.
-
completedParts
public List<Integer> completedParts()
The lists of parts that were successfully completed and saved to the file. Non-empty only for multipart downloads.- Returns:
- part numbers of a multipart download that were completed saved to file.
-
serializeToFile
public void serializeToFile(Path path)
Persists this download object to a file in Base64-encoded JSON format.- Specified by:
serializeToFilein interfaceResumableTransfer- Parameters:
path- The path to the file to which you want to write the serialized download object.
-
serializeToOutputStream
public void serializeToOutputStream(OutputStream outputStream)
Writes the serialized JSON data representing this object to an output stream. Note that theOutputStreamis not closed or flushed after writing.- Specified by:
serializeToOutputStreamin interfaceResumableTransfer- Parameters:
outputStream- The output stream to write the serialized object to.
-
serializeToString
public String serializeToString()
Returns the serialized JSON data representing this object as a string.- Specified by:
serializeToStringin interfaceResumableTransfer
-
serializeToBytes
public SdkBytes serializeToBytes()
Returns the serialized JSON data representing this object as anSdkBytesobject.- Specified by:
serializeToBytesin interfaceResumableTransfer- Returns:
- the serialized JSON as
SdkBytes
-
serializeToInputStream
public InputStream serializeToInputStream()
Returns the serialized JSON data representing this object as anInputStream.- Specified by:
serializeToInputStreamin interfaceResumableTransfer- Returns:
- the serialized JSON input stream
-
fromFile
public static ResumableFileDownload fromFile(Path path)
Deserialize data at the given path into aResumableFileDownload.- Parameters:
path- ThePathto the file with serialized data- Returns:
- the deserialized
ResumableFileDownload
-
fromBytes
public static ResumableFileDownload fromBytes(SdkBytes bytes)
Deserialize bytes with JSON data into aResumableFileDownload.- Parameters:
bytes- the serialized data- Returns:
- the deserialized
ResumableFileDownload
-
fromString
public static ResumableFileDownload fromString(String contents)
Deserialize a string with JSON data into aResumableFileDownload.- Parameters:
contents- the serialized data- Returns:
- the deserialized
ResumableFileDownload
-
toBuilder
public ResumableFileDownload.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<ResumableFileDownload.Builder,ResumableFileDownload>
-
-