Search in sources :

Example 11 with AccessControlList

use of com.aliyun.oss.model.AccessControlList in project aliyun-oss-java-sdk by aliyun.

the class BucketOperationsSample method doBucketACLOperations.

private static void doBucketACLOperations() {
    System.out.println("Setting bucket ACL to " + CannedAccessControlList.PublicRead.toString() + "\n");
    client.setBucketAcl(bucketName, CannedAccessControlList.PublicRead);
    AccessControlList acl = client.getBucketAcl(bucketName);
    System.out.println("Getting bucket ACL " + acl.toString() + "\n");
}
Also used : CannedAccessControlList(com.aliyun.oss.model.CannedAccessControlList) AccessControlList(com.aliyun.oss.model.AccessControlList)

Aggregations

AccessControlList (com.aliyun.oss.model.AccessControlList)11 CannedAccessControlList (com.aliyun.oss.model.CannedAccessControlList)9 OSSException (com.aliyun.oss.OSSException)7 Grant (com.aliyun.oss.model.Grant)7 Test (org.junit.Test)6 CreateBucketRequest (com.aliyun.oss.model.CreateBucketRequest)4 BucketList (com.aliyun.oss.model.BucketList)3 Owner (com.aliyun.oss.model.Owner)2 ArrayList (java.util.ArrayList)2 Ignore (org.junit.Ignore)2 OSSClient (com.aliyun.oss.OSSClient)1 ResponseParseException (com.aliyun.oss.common.parser.ResponseParseException)1 BucketLoggingResult (com.aliyun.oss.model.BucketLoggingResult)1 BucketReferer (com.aliyun.oss.model.BucketReferer)1 LifecycleRule (com.aliyun.oss.model.LifecycleRule)1 ObjectListing (com.aliyun.oss.model.ObjectListing)1 PutObjectResult (com.aliyun.oss.model.PutObjectResult)1 SetBucketCORSRequest (com.aliyun.oss.model.SetBucketCORSRequest)1 CORSRule (com.aliyun.oss.model.SetBucketCORSRequest.CORSRule)1 SetBucketLifecycleRequest (com.aliyun.oss.model.SetBucketLifecycleRequest)1