Class ResumableFileUpload
- java.lang.Object
-
- software.amazon.awssdk.transfer.s3.model.ResumableFileUpload
-
- All Implemented Interfaces:
ResumableTransfer,ToCopyableBuilder<ResumableFileUpload.Builder,ResumableFileUpload>
public final class ResumableFileUpload extends Object implements ResumableTransfer, ToCopyableBuilder<ResumableFileUpload.Builder,ResumableFileUpload>
POJO class that holds the state and can be used to resume a paused upload file 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 interfaceResumableFileUpload.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ResumableFileUpload.Builderbuilder()booleanequals(Object o)InstantfileLastModified()Last modified time of the file since last pauselongfileLength()File length since last pausestatic ResumableFileUploadfromBytes(SdkBytes bytes)Deserializes bytes with JSON data into aResumableFileUpload.static ResumableFileUploadfromFile(Path path)Deserializes data at the given path into aResumableFileUpload.static ResumableFileUploadfromString(String contents)Deserializes a string with JSON data into aResumableFileUpload.inthashCode()Optional<String>multipartUploadId()The multipart upload ID, orOptional.empty()if unknownOptionalLongpartSizeInBytes()Return the part size in bytes orOptionalLong.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.ResumableFileUpload.BuildertoBuilder()StringtoString()OptionalLongtotalParts()Return the total number of parts associated with this transfer orOptionalLong.empty()if unknownOptionalLongtransferredParts()Return the total number of parts completed with this transfer orOptionalLong.empty()if unknownUploadFileRequestuploadFileRequest()-
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 ResumableFileUpload.Builder builder()
-
uploadFileRequest
public UploadFileRequest uploadFileRequest()
- Returns:
- the
UploadFileRequestto resume
-
fileLastModified
public Instant fileLastModified()
Last modified time of the file since last pause
-
fileLength
public long fileLength()
File length since last pause
-
partSizeInBytes
public OptionalLong partSizeInBytes()
Return the part size in bytes orOptionalLong.empty()if unknown
-
totalParts
public OptionalLong totalParts()
Return the total number of parts associated with this transfer orOptionalLong.empty()if unknown
-
multipartUploadId
public Optional<String> multipartUploadId()
The multipart upload ID, orOptional.empty()if unknown- Returns:
- the optional total size of the transfer.
-
transferredParts
public OptionalLong transferredParts()
Return the total number of parts completed with this transfer orOptionalLong.empty()if unknown
-
serializeToFile
public void serializeToFile(Path path)
Description copied from interface:ResumableTransferPersists 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)
Description copied from interface:ResumableTransferWrites 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()
Description copied from interface:ResumableTransferReturns the serialized JSON data representing this object as a string.- Specified by:
serializeToStringin interfaceResumableTransfer
-
serializeToBytes
public SdkBytes serializeToBytes()
Description copied from interface:ResumableTransferReturns the serialized JSON data representing this object as anSdkBytesobject.- Specified by:
serializeToBytesin interfaceResumableTransfer- Returns:
- the serialized JSON as
SdkBytes
-
serializeToInputStream
public InputStream serializeToInputStream()
Description copied from interface:ResumableTransferReturns the serialized JSON data representing this object as anInputStream.- Specified by:
serializeToInputStreamin interfaceResumableTransfer- Returns:
- the serialized JSON input stream
-
fromFile
public static ResumableFileUpload fromFile(Path path)
Deserializes data at the given path into aResumableFileUpload.- Parameters:
path- ThePathto the file with serialized data- Returns:
- the deserialized
ResumableFileUpload
-
fromBytes
public static ResumableFileUpload fromBytes(SdkBytes bytes)
Deserializes bytes with JSON data into aResumableFileUpload.- Parameters:
bytes- the serialized data- Returns:
- the deserialized
ResumableFileUpload
-
fromString
public static ResumableFileUpload fromString(String contents)
Deserializes a string with JSON data into aResumableFileUpload.- Parameters:
contents- the serialized data- Returns:
- the deserialized
ResumableFileUpload
-
toBuilder
public ResumableFileUpload.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<ResumableFileUpload.Builder,ResumableFileUpload>
-
-