use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSBucketOperation method getBucketInfo.
public BucketInfo getBucketInfo(GenericRequest genericRequest) throws OSSException, ClientException {
assertParameterNotNull(genericRequest, "genericRequest");
String bucketName = genericRequest.getBucketName();
assertParameterNotNull(bucketName, "bucketName");
ensureBucketNameValid(bucketName);
Map<String, String> params = new HashMap<String, String>();
params.put(RequestParameters.SUBRESOURCE_BUCKET_INFO, null);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.GET).setBucket(bucketName).setParameters(params).setOriginalRequest(genericRequest).build();
return doOperation(request, getBucketInfoResponseParser, bucketName, null, true);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSBucketOperation method deleteBucketReplication.
/**
* Delete bucket replication.
*/
public void deleteBucketReplication(DeleteBucketReplicationRequest deleteBucketReplicationRequest) throws OSSException, ClientException {
assertParameterNotNull(deleteBucketReplicationRequest, "deleteBucketReplicationRequest");
assertParameterNotNull(deleteBucketReplicationRequest.getReplicationRuleID(), "replicationRuleID");
String bucketName = deleteBucketReplicationRequest.getBucketName();
assertParameterNotNull(bucketName, "bucketName");
ensureBucketNameValid(bucketName);
Map<String, String> params = new LinkedHashMap<String, String>();
params.put(RequestParameters.SUBRESOURCE_REPLICATION, null);
params.put(RequestParameters.SUBRESOURCE_COMP, RequestParameters.COMP_DELETE);
byte[] rawContent = deleteBucketReplicationRequestMarshaller.marshall(deleteBucketReplicationRequest);
Map<String, String> headers = new HashMap<String, String>();
addRequestRequiredHeaders(headers, rawContent);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.POST).setBucket(bucketName).setParameters(params).setHeaders(headers).setInputSize(rawContent.length).setInputStream(new ByteArrayInputStream(rawContent)).setOriginalRequest(deleteBucketReplicationRequest).build();
doOperation(request, emptyResponseParser, bucketName, null);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSBucketOperation method setBucketTagging.
/**
* Set bucket tagging.
*/
public void setBucketTagging(SetBucketTaggingRequest setBucketTaggingRequest) throws OSSException, ClientException {
assertParameterNotNull(setBucketTaggingRequest, "setBucketTaggingRequest");
String bucketName = setBucketTaggingRequest.getBucketName();
assertParameterNotNull(bucketName, "bucketName");
ensureBucketNameValid(bucketName);
Map<String, String> params = new HashMap<String, String>();
params.put(SUBRESOURCE_TAGGING, null);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.PUT).setBucket(bucketName).setParameters(params).setInputStreamWithLength(setBucketTaggingRequestMarshaller.marshall(setBucketTaggingRequest)).setOriginalRequest(setBucketTaggingRequest).build();
doOperation(request, emptyResponseParser, bucketName, null);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSBucketOperation method getBucketReplicationLocation.
/**
* Get bucket replication progress.
*/
public List<String> getBucketReplicationLocation(GenericRequest genericRequest) throws OSSException, ClientException {
assertParameterNotNull(genericRequest, "genericRequest");
String bucketName = genericRequest.getBucketName();
assertParameterNotNull(bucketName, "bucketName");
ensureBucketNameValid(bucketName);
Map<String, String> params = new HashMap<String, String>();
params.put(RequestParameters.SUBRESOURCE_REPLICATION_LOCATION, null);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.GET).setBucket(bucketName).setParameters(params).setOriginalRequest(genericRequest).build();
return doOperation(request, getBucketReplicationLocationResponseParser, bucketName, null, true);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSBucketOperation method getBucketAcl.
/**
* Get bucket's ACL.
*/
public AccessControlList getBucketAcl(GenericRequest genericRequest) throws OSSException, ClientException {
assertParameterNotNull(genericRequest, "genericRequest");
String bucketName = genericRequest.getBucketName();
assertParameterNotNull(bucketName, "bucketName");
ensureBucketNameValid(bucketName);
Map<String, String> params = new HashMap<String, String>();
params.put(SUBRESOURCE_ACL, null);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.GET).setBucket(bucketName).setParameters(params).setOriginalRequest(genericRequest).build();
return doOperation(request, getBucketAclResponseParser, bucketName, null, true);
}
Aggregations