Interface FileUpload
- All Superinterfaces:
ObjectTransfer,Transfer
- All Known Implementing Classes:
CrtFileUpload,DefaultFileUpload
-
Method Summary
Modifier and TypeMethodDescriptionpause()Pauses the current upload operation and return the information that can be used to resume the upload at a later time.Methods inherited from interface software.amazon.awssdk.transfer.s3.model.ObjectTransfer
progress
-
Method Details
-
pause
ResumableFileUpload pause()Pauses 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 andcompletionFuture()completes exceptionally withCancellationException. If the upload failed beforeCompleteMultipartUploadstarted, the result can still have a multipart upload ID in case the multipart upload still exists, andcompletionFuture()keeps the original failure. If no multipart upload ID is returned, the pause had no effect, andcompletionFuture()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.- Returns:
- A
ResumableFileUploadthat can be used to resume the upload.
-
completionFuture
CompletableFuture<CompletedFileUpload> completionFuture()- Specified by:
completionFuturein interfaceTransfer- Returns:
- The future that will be completed when this transfer is complete.
-