use of com.qcloud.cos.internal.SetObjectTaggingResponseHeaderHandler in project cos-java-sdk-v5 by tencentyun.
the class COSClient method setObjectTagging.
@Override
public SetObjectTaggingResult setObjectTagging(SetObjectTaggingRequest setObjectTaggingRequest) {
rejectNull(setObjectTaggingRequest, "The request parameter must be specified setting the object tags");
rejectNull(setObjectTaggingRequest.getBucketName(), "The request bucketName must be specified setting the object tags");
rejectNull(setObjectTaggingRequest.getKey(), "The request key must be specified setting the object tags");
rejectNull(setObjectTaggingRequest.getTagging(), "The request tagging must be specified setting the object tags");
CosHttpRequest<SetObjectTaggingRequest> request = createRequest(setObjectTaggingRequest.getBucketName(), setObjectTaggingRequest.getKey(), setObjectTaggingRequest, HttpMethodName.PUT);
request.addParameter("tagging", null);
addParameterIfNotNull(request, "versionId", setObjectTaggingRequest.getVersionId());
byte[] content = new ObjectTaggingXmlFactory().convertToXmlByteArray(setObjectTaggingRequest.getTagging());
setContent(request, content, "application/xml", true);
ResponseHeaderHandlerChain<SetObjectTaggingResult> handlerChain = new ResponseHeaderHandlerChain<SetObjectTaggingResult>(new Unmarshallers.SetObjectTaggingResponseUnmarshaller(), new SetObjectTaggingResponseHeaderHandler());
return invoke(request, handlerChain);
}
Aggregations