Class DefaultFileUpload
- All Implemented Interfaces:
FileUpload,ObjectTransfer,Transfer
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultFileUpload(CompletableFuture<CompletedFileUpload> completionFuture, TransferProgress progress, PauseObservable pauseObservable, UploadFileRequest request) -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()pause()Pauses the current upload operation and return the information that can be used to resume the upload at a later time.progress()The statefulTransferProgressassociated with this transfer.toString()
-
Constructor Details
-
DefaultFileUpload
public DefaultFileUpload(CompletableFuture<CompletedFileUpload> completionFuture, TransferProgress progress, PauseObservable pauseObservable, UploadFileRequest request)
-
-
Method Details
-
pause
Description copied from interface:FileUploadPauses the current upload operation and return the information that can be used to resume the upload at a later time.The information object is serializable for persistent storage until it should be resumed. See
ResumableFileUploadfor supported formats.For a Java-based multipart-enabled
S3AsyncClient, if the pause stops the upload, the returnedResumableFileUploadhas a multipart upload ID andFileUpload.completionFuture()completes exceptionally withCancellationException. If the upload failed beforeCompleteMultipartUploadstarted, the result can still have a multipart upload ID in case the multipart upload still exists, andFileUpload.completionFuture()keeps the original failure. If no multipart upload ID is returned, the pause had no effect, andFileUpload.completionFuture()reports the upload's result.Currently, it's only supported if the underlying
S3AsyncClientis CRT-based (created viaS3AsyncClient.crtBuilder()orS3AsyncClient.crtCreate()), OR the underlyingS3AsyncClienthas multipart enabled (S3AsyncClientBuilder.multipartConfiguration(MultipartConfiguration)orS3AsyncClientBuilder.multipartEnabled(Boolean)). It will throwUnsupportedOperationExceptionif theS3TransferManageris created with a non CRT-based S3 client (created viaS3AsyncClient.builder()) and does not have multipart configuration enabled.- Specified by:
pausein interfaceFileUpload- Returns:
- A
ResumableFileUploadthat can be used to resume the upload.
-
completionFuture
- Specified by:
completionFuturein interfaceFileUpload- Specified by:
completionFuturein interfaceTransfer- Returns:
- The future that will be completed when this transfer is complete.
-
progress
Description copied from interface:ObjectTransferThe statefulTransferProgressassociated with this transfer.- Specified by:
progressin interfaceObjectTransfer
-
equals
-
hashCode
-
toString
-