@ Override public S3Recoverable snapshotAndGetRecoverable ( @ Nullable final RefCountedFSOutputStream incompletePartFile ) throws IOException { final String incompletePartObjectName = safelyUploadSmallPart ( incompletePartFile ) ; // make sure all other uploads are complete // this currently makes the method blocking, // to be made non-blocking in the future awaitPendingPartsUpload ( ) ; final String objectName = currentUploadInfo . getObjectName ( ) ; final String uploadId = currentUploadInfo . getUploadId ( ) ; final List < PartETag > completedParts = currentUploadInfo . getCopyOfEtagsOfCompleteParts ( ) ; final long sizeInBytes = currentUploadInfo . getExpectedSizeInBytes ( ) ; if ( incompletePartObjectName == null ) { return new S3Recoverable ( objectName , uploadId , completedParts , sizeInBytes ) ; } else { return new S3Recoverable ( objectName , uploadId , completedParts , sizeInBytes , incompletePartObjectName , incompletePartFile . getPos ( ) ) ; } }
Creates a snapshot of this MultiPartUpload from which the upload can be resumed .