resovles #1648 set content type multipart upload #2672
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.
Resolves #1648
The issue is a feature request calling for automatically setting the content-type header of a multipart upload. Similar to how the putObject method in the S3Client does it, by using the file extension. Multipart uploads happen in 3 parts, initiate, send parts, and close. The initiate does not take a file. Initiate allows setting the content type in the object metadata. I expect that initiateMultipartUpload will continue to determine content type from object metadata. This seems like a fine way to do it, but I see there is still an open issue here, and is flagged for community help-wanted. I added helper methods to set the content type given a file that will upload. I kept the method name long and descriptive to show this is setting the content type in the object metadata, while there is still the existing setters to set the metadata. Use of existing methods is not disrupted or changed in any way.
Also, I see there are no unit tests in the src code, but I also read in gitter that unit tests are welcome in pull requests. I can remove those if needed.
In the issue #1648, the question was because spring-cloud-aws was not allowing the user to set the content type. This has since been fixed. spring-attic/spring-cloud-aws#262.