use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSBucketOperation method getBucketImage.
/**
* Get bucket image
*/
public GetBucketImageResult getBucketImage(String bucketName, GenericRequest genericRequest) {
assertParameterNotNull(bucketName, "bucketName");
ensureBucketNameValid(bucketName);
Map<String, String> params = new HashMap<String, String>();
params.put(SUBRESOURCE_IMG, null);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.GET).setBucket(bucketName).setParameters(params).setOriginalRequest(genericRequest).build();
return doOperation(request, getBucketImageResponseParser, bucketName, null, true);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSBucketOperation method listBuckets.
/**
* List all my buckets.
*/
public BucketList listBuckets(ListBucketsRequest listBucketRequest) throws OSSException, ClientException {
assertParameterNotNull(listBucketRequest, "listBucketRequest");
Map<String, String> params = new LinkedHashMap<String, String>();
if (listBucketRequest.getPrefix() != null) {
params.put(PREFIX, listBucketRequest.getPrefix());
}
if (listBucketRequest.getMarker() != null) {
params.put(MARKER, listBucketRequest.getMarker());
}
if (listBucketRequest.getMaxKeys() != null) {
params.put(MAX_KEYS, Integer.toString(listBucketRequest.getMaxKeys()));
}
if (listBucketRequest.getBid() != null) {
params.put(BID, listBucketRequest.getBid());
}
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.GET).setParameters(params).setOriginalRequest(listBucketRequest).build();
return doOperation(request, listBucketResponseParser, null, null, true);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSBucketOperation method deleteBucketCname.
public void deleteBucketCname(DeleteBucketCnameRequest deleteBucketCnameRequest) throws OSSException, ClientException {
assertParameterNotNull(deleteBucketCnameRequest, "deleteBucketCnameRequest");
assertParameterNotNull(deleteBucketCnameRequest.getDomain(), "deleteBucketCnameRequest.domain");
String bucketName = deleteBucketCnameRequest.getBucketName();
assertParameterNotNull(bucketName, "bucketName");
ensureBucketNameValid(bucketName);
Map<String, String> params = new HashMap<String, String>();
params.put(RequestParameters.SUBRESOURCE_CNAME, null);
params.put(RequestParameters.SUBRESOURCE_COMP, RequestParameters.COMP_DELETE);
byte[] rawContent = deleteBucketCnameRequestMarshaller.marshall(deleteBucketCnameRequest);
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(deleteBucketCnameRequest).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 deleteBucket.
/**
* Delete a bucket.
*/
public void deleteBucket(GenericRequest genericRequest) throws OSSException, ClientException {
assertParameterNotNull(genericRequest, "genericRequest");
String bucketName = genericRequest.getBucketName();
assertParameterNotNull(bucketName, "bucketName");
ensureBucketNameValid(bucketName);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.DELETE).setBucket(bucketName).setOriginalRequest(genericRequest).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 deleteBucketLifecycle.
/**
* Delete bucket lifecycle.
*/
public void deleteBucketLifecycle(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_LIFECYCLE, null);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.DELETE).setBucket(bucketName).setParameters(params).setOriginalRequest(genericRequest).build();
doOperation(request, emptyResponseParser, bucketName, null);
}
Aggregations