use of com.qcloud.cos.internal.COSDefaultAclHeaderHandler in project cos-java-sdk-v5 by tencentyun.
the class COSClient method getAcl.
/**
* <p>
* Gets the AccessControlList for the specified resource. (bucket if only the bucketName
* parameter is specified, otherwise the object with the specified key in the bucket).
* </p>
*
* @param bucketName The name of the bucket whose ACL should be returned if the key parameter is
* not specified, otherwise the bucket containing the specified key.
* @param key The object key whose ACL should be retrieve. If not specified, the bucket's ACL is
* returned.
* @param versionId The version ID of the object version whose ACL is being retrieved.
* @param originalRequest The original, user facing request object.
*
* @return The ACL for the specified resource.
*/
private AccessControlList getAcl(String bucketName, String key, String versionId, CosServiceRequest originalRequest) {
if (originalRequest == null)
originalRequest = new GenericBucketRequest(bucketName);
CosHttpRequest<CosServiceRequest> request = createRequest(bucketName, key, originalRequest, HttpMethodName.GET);
request.addParameter("acl", null);
if (versionId != null) {
request.addParameter("versionId", versionId);
}
@SuppressWarnings("unchecked") ResponseHeaderHandlerChain<AccessControlList> responseHandler = new ResponseHeaderHandlerChain<AccessControlList>(new Unmarshallers.AccessControlListUnmarshaller(), new COSDefaultAclHeaderHandler());
return invoke(request, responseHandler);
}
Aggregations