Migration Tool: PutObjectRequest File/InputStream transform#5942
Merged
Migration Tool: PutObjectRequest File/InputStream transform#5942
Conversation
dagnir
reviewed
Mar 11, 2025
.../software/amazon/awssdk/v2migrationtests/maven/after/src/main/java/foo/bar/S3_Streaming.java
Outdated
Show resolved
Hide resolved
...e/amazon/awssdk/v2migrationtests/maven-tm/after/src/main/java/foo/bar/TransferManagerS3.java
Outdated
Show resolved
Hide resolved
v2-migration/src/main/java/software/amazon/awssdk/v2migration/S3PutObjectRequestToV2.java
Outdated
Show resolved
Hide resolved
v2-migration/src/main/java/software/amazon/awssdk/v2migration/S3PutObjectRequestToV2.java
Show resolved
Hide resolved
zoewangg
reviewed
Mar 11, 2025
.../amazon/awssdk/v2migrationtests/maven-tm/before/src/main/java/foo/bar/TransferManagerS3.java
Show resolved
Hide resolved
...e/amazon/awssdk/v2migrationtests/maven-tm/after/src/main/java/foo/bar/TransferManagerS3.java
Outdated
Show resolved
Hide resolved
.../software/amazon/awssdk/v2migrationtests/maven/after/src/main/java/foo/bar/S3_Streaming.java
Outdated
Show resolved
Hide resolved
...software/amazon/awssdk/v2migrationtests/maven/before/src/main/java/foo/bar/S3_Streaming.java
Show resolved
Hide resolved
...e/amazon/awssdk/v2migrationtests/maven-tm/after/src/main/java/foo/bar/TransferManagerS3.java
Outdated
Show resolved
Hide resolved
dagnir
approved these changes
Mar 13, 2025
zoewangg
approved these changes
Mar 17, 2025
...amazon/awssdk/v2migrationtests/maven-nocompile/after/src/main/java/foo/bar/S3Transforms.java
Outdated
Show resolved
Hide resolved
|
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
Modifications
Refactored common code to
S3TransformUtils(separate commit)Transforms for
PutObjectRequest:PutObjectRequest(String bucketName, String key, File file)PutObjectRequest(String bucketName, String key, String redirectLocation)withFilesetFilewithInputStreamsetInputStreamwithRequesterPayswithBucketNamewithCannedAclTransforms for
AmazonS3.putObject(PutObjectRequest)RequestBody.empty()Fileset:RequestBody.fromFile()InputStreamset:Content-Lengthprovided:RequestBody.fromInputStream(inputStream, contentLength)RequestBody.fromContentProvider(() -> inputStream, "binary/octet-stream")(comment will be added to tell users to specify length, and warn stream will be buffered)Transforms for
TransferManager.upload(PutObjectRequest)tm.upload(UploadRequest...requestBody(AsyncRequestBody.empty())Fileset:tm.uploadFile(UploadFileRequest...source(file)InputStreamset:Content-Lengthnot provided, will default to-1tm.upload(UploadRequest...requestBody(AsyncRequestBody.fromInputStream(inputStream, contentLength, newExecutorServiceVariableToDefine)TODO in follow up PRs:
ObjectMetadataand pass onContent-LengthtoRequestBody.fromInputStream()/AsyncRequestBody.fromInputStream()PutObjectRequestsettersTesting
added end to end tests