use of com.amazonaws.services.s3.model.transform.ObjectTaggingXmlFactory in project aws-sdk-android by aws-amplify.
the class AmazonS3Client method setObjectTagging.
@Override
public SetObjectTaggingResult setObjectTagging(SetObjectTaggingRequest setObjectTaggingRequest) {
assertParameterNotNull(setObjectTaggingRequest, "The request parameter must be specified setting the object tags");
final String bucketName = assertStringNotEmpty(setObjectTaggingRequest.getBucketName(), "BucketName");
final String key = assertNotNull(setObjectTaggingRequest.getKey(), "Key");
final ObjectTagging tagging = assertNotNull(setObjectTaggingRequest.getTagging(), "ObjectTagging");
final Request<SetObjectTaggingRequest> request = createRequest(bucketName, key, setObjectTaggingRequest, HttpMethodName.PUT);
request.addParameter("tagging", null);
addParameterIfNotNull(request, "versionId", setObjectTaggingRequest.getVersionId());
final byte[] content = new ObjectTaggingXmlFactory().convertToXmlByteArray(tagging);
setContent(request, content, "application/xml", true);
final ResponseHeaderHandlerChain<SetObjectTaggingResult> handlerChain = new ResponseHeaderHandlerChain<SetObjectTaggingResult>(new Unmarshallers.SetObjectTaggingResponseUnmarshaller(), new SetObjectTaggingResponseHeaderHandler());
return invoke(request, handlerChain, bucketName, key);
}
Aggregations