alexmojaki / s3-stream-upload

Manages streaming of data to AWS S3 without knowing the size beforehand and without keeping it all in memory or writing to disk.
MIT License
208 stars 62 forks source link

Support setting custom object metadata #44

Closed nikolajovickg closed 2 years ago

nikolajovickg commented 2 years ago

Right now, there's no way to set custom object metadata during multipart upload initialization, whereas it could be either exposed as an argument to the complete() method, or in the builder during manager initialization.

alexmojaki commented 2 years ago

While performing the multipart upload this class will create instances of InitiateMultipartUploadRequest, UploadPartRequest, and CompleteMultipartUploadRequest, fill in the essential details, and send them off. If you need to add additional details then override the appropriate customise*Request methods and set the required properties within. Note that if no data is written (i.e. the object body is empty) then a normal (not multipart) upload will be performed and customisePutEmptyObjectRequest will be called instead.

http://alexmojaki.github.io/s3-stream-upload/javadoc/apidocs/alex/mojaki/s3upload/StreamTransferManager.html

Try overriding customiseInitiateRequest and maybe customisePutEmptyObjectRequest.

nikolajovickg commented 2 years ago

Thanks, that did the job