use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSBucketOperation method setBucketLifecycle.
/**
* Set bucket lifecycle.
*/
public void setBucketLifecycle(SetBucketLifecycleRequest setBucketLifecycleRequest) throws OSSException, ClientException {
assertParameterNotNull(setBucketLifecycleRequest, "setBucketLifecycleRequest");
String bucketName = setBucketLifecycleRequest.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.PUT).setBucket(bucketName).setParameters(params).setInputStreamWithLength(setBucketLifecycleRequestMarshaller.marshall(setBucketLifecycleRequest)).setOriginalRequest(setBucketLifecycleRequest).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 getBucketLogging.
/**
* Get bucket logging.
*/
public BucketLoggingResult getBucketLogging(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_LOGGING, null);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.GET).setBucket(bucketName).setParameters(params).setOriginalRequest(genericRequest).build();
return doOperation(request, getBucketLoggingResponseParser, bucketName, null, true);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSBucketOperation method setBucketLogging.
/**
* Set bucket logging.
*/
public void setBucketLogging(SetBucketLoggingRequest setBucketLoggingRequest) throws OSSException, ClientException {
assertParameterNotNull(setBucketLoggingRequest, "setBucketLoggingRequest");
String bucketName = setBucketLoggingRequest.getBucketName();
assertParameterNotNull(bucketName, "bucketName");
ensureBucketNameValid(bucketName);
Map<String, String> params = new HashMap<String, String>();
params.put(SUBRESOURCE_LOGGING, null);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.PUT).setBucket(bucketName).setParameters(params).setInputStreamWithLength(setBucketLoggingRequestMarshaller.marshall(setBucketLoggingRequest)).setOriginalRequest(setBucketLoggingRequest).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 listObjects.
/**
* List objects under the specified bucket.
*/
public ObjectListing listObjects(ListObjectsRequest listObjectsRequest) throws OSSException, ClientException {
assertParameterNotNull(listObjectsRequest, "listObjectsRequest");
String bucketName = listObjectsRequest.getBucketName();
assertParameterNotNull(bucketName, "bucketName");
ensureBucketNameValid(bucketName);
Map<String, String> params = new LinkedHashMap<String, String>();
populateListObjectsRequestParameters(listObjectsRequest, params);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.GET).setBucket(bucketName).setParameters(params).setOriginalRequest(listObjectsRequest).build();
return doOperation(request, listObjectsReponseParser, bucketName, null, true);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSBucketOperation method setBucketWebsite.
/**
* Set bucket website.
*/
public void setBucketWebsite(SetBucketWebsiteRequest setBucketWebSiteRequest) throws OSSException, ClientException {
assertParameterNotNull(setBucketWebSiteRequest, "setBucketWebSiteRequest");
String bucketName = setBucketWebSiteRequest.getBucketName();
assertParameterNotNull(bucketName, "bucketName");
ensureBucketNameValid(bucketName);
if (setBucketWebSiteRequest.getIndexDocument() == null && setBucketWebSiteRequest.getErrorDocument() == null && setBucketWebSiteRequest.getRoutingRules().size() == 0) {
throw new IllegalArgumentException(String.format("IndexDocument/ErrorDocument/RoutingRules must have one"));
}
Map<String, String> params = new HashMap<String, String>();
params.put(SUBRESOURCE_WEBSITE, null);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.PUT).setBucket(bucketName).setParameters(params).setInputStreamWithLength(setBucketWebsiteRequestMarshaller.marshall(setBucketWebSiteRequest)).setOriginalRequest(setBucketWebSiteRequest).build();
doOperation(request, emptyResponseParser, bucketName, null);
}
Aggregations