You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is special AsyncRequestBody implementation for uploading content to S3 by InputStream. It is BlockingInputStreamAsyncRequestBody. This class is useful and simple, but it has no way to set custom content-type:
class is final (so, no way to inherit from it)
no contentType method overriding (so, default implementation from AsyncRequestBody used instead. That implementation simply always returns application/octet-stream)
Use Case
Any time I need to upload my existing InputStream, I want to use this BlockingInputStreamAsyncRequestBody. But, then my content type is differ from application/octet-stream (almost always), I need to have own copy-past implementation with my custom content-type...
Proposed Solution
Add private final field contentType to BlockingInputStreamAsyncRequestBody
Add new constructor with additional argument contentType
Override contentType method to return corresponding field
Other Information
No response
Acknowledgements
I may be able to implement this feature request
This feature might incur a breaking change
AWS Java SDK version used
2.25.37
JDK version used
java 17.0.6 2023-01-17 LTS Java(TM) SE Runtime Environment (build 17.0.6+9-LTS-190) Java HotSpot(TM) 64-Bit Server VM (build 17.0.6+9-LTS-190, mixed mode, sharing)
Operating System and version
Ubuntu 22.04.3 LTS
The text was updated successfully, but these errors were encountered:
Describe the feature
There is special
AsyncRequestBody
implementation for uploading content to S3 byInputStream
. It isBlockingInputStreamAsyncRequestBody
. This class is useful and simple, but it has no way to set custom content-type:contentType
method overriding (so, default implementation fromAsyncRequestBody
used instead. That implementation simply always returnsapplication/octet-stream
)Use Case
Any time I need to upload my existing
InputStream
, I want to use thisBlockingInputStreamAsyncRequestBody
. But, then my content type is differ fromapplication/octet-stream
(almost always), I need to have own copy-past implementation with my custom content-type...Proposed Solution
contentType
toBlockingInputStreamAsyncRequestBody
contentType
contentType
method to return corresponding fieldOther Information
No response
Acknowledgements
AWS Java SDK version used
2.25.37
JDK version used
java 17.0.6 2023-01-17 LTS Java(TM) SE Runtime Environment (build 17.0.6+9-LTS-190) Java HotSpot(TM) 64-Bit Server VM (build 17.0.6+9-LTS-190, mixed mode, sharing)
Operating System and version
Ubuntu 22.04.3 LTS
The text was updated successfully, but these errors were encountered: