Add PresignedFileDownload return type for presigned URL downloads#7004
Open
jencymaryjoseph wants to merge 1 commit into
Conversation
9a4fa5f to
dd0a645
Compare
joviegas
reviewed
May 29, 2026
| * A download transfer of a single object from S3 using a presigned URL. | ||
| * | ||
| * <p>Unlike {@link FileDownload}, this type does not support pause/resume because presigned URLs | ||
| * have a limited lifetime and cannot be reliably resumed after expiration. |
Contributor
There was a problem hiding this comment.
Is the expiry time only limitation for not implementing this for pause/resume?
| import software.amazon.awssdk.utils.Validate; | ||
|
|
||
| @SdkInternalApi | ||
| public final class DefaultPresignedFileDownload implements PresignedFileDownload { |
Contributor
There was a problem hiding this comment.
We can add equals and hashcode methods and also add test with EqualsVerifier something like DefaultDownloadTest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
downloadFileWithPresignedUrl() previously returnedFileDownload, which exposespause(). Pause is not supported for presigned URL downloads. Calling pause() threwUnsupportedOperationExceptionat runtime - a bad customer experience. This PR introducesPresignedFileDownload, a new return type that provides compile-time safety by not exposing pause().Modifications
PresignedFileDownloadinterface (extendsObjectTransfer— hascompletionFuture() andprogress(), nopause())DefaultPresignedFileDownloadinternal implementationS3TransferManager.downloadFileWithPresignedUrl() return type fromFileDownloadto PresignedFileDownloadDelegatingS3TransferManagerandGenericS3TransferManageraccordinglyUnsupportedOperationExceptionfromGenericS3TransferManagerTesting
PresignedFileDownloadreturn typeScreenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License