Class PlainTextMultipartUploadReader

java.lang.Object
org.apache.hadoop.ozone.s3.endpoint.PlainTextMultipartUploadReader
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<CompleteMultipartUploadRequest>

@Provider @Consumes("text/plain") public class PlainTextMultipartUploadReader extends Object implements javax.ws.rs.ext.MessageBodyReader<CompleteMultipartUploadRequest>
Body reader to accept plain text MPU.

Aws s3 api sends a multipartupload request with the content type 'text/plain' in case of using 'aws s3 cp' (instead of aws s3api).

Our generic ObjectEndpoint.multipartUpload has a CompleteMultipartUploadRequest parameter, which is required only for the completion request.

But JaxRS tries to parse it from the body for the requests and in case of text/plain requests this parsing is failed. This simple BodyReader enables to parse an empty text/plain message and return with an empty completion request.