/** * Applies access control settings to a bucket. The ACL settings must be included * inside the bucket. * * This method can be performed by anonymous services, but can only succeed if the * bucket's existing ACL already allows write access by the anonymous user. * In general, you can only access the ACL of a bucket if the ACL already in place * for that bucket allows you to do so. * * @param bucket * a bucket with ACL settings to apply. * @throws ServiceException */ public void putBucketAcl(StorageBucket bucket) throws ServiceException { assertValidBucket(bucket, "Put Bucket Access Control List"); putBucketAcl(bucket.getName(), bucket.getAcl()); }
/** * Applies access control settings to a bucket. The ACL settings must be included * inside the bucket. * * This method can be performed by anonymous services, but can only succeed if the * bucket's existing ACL already allows write access by the anonymous user. * In general, you can only access the ACL of a bucket if the ACL already in place * for that bucket allows you to do so. * * @param bucket * a bucket with ACL settings to apply. * @throws ServiceException */ public void putBucketAcl(StorageBucket bucket) throws ServiceException { assertValidBucket(bucket, "Put Bucket Access Control List"); putBucketAcl(bucket.getName(), bucket.getAcl()); }
/** * Create a bucket with the Access Control List settings of the bucket object (if any). * <p> * <b>Caution:</b> Performing this operation unnecessarily when a bucket already * exists may cause OperationAborted errors with the message "A conflicting conditional * operation is currently in progress against this resource.". To avoid this error, use the * {@link #getOrCreateBucket(String)} in situations where the bucket may already exist. * <p> * This method cannot be performed by anonymous services. * * @param bucket * the bucket to create, including optional ACL settings. * @return * the created bucket object. <b>Note:</b> the object returned has minimal information about * the bucket that was created, including only the bucket's name. * @throws ServiceException */ public StorageBucket createBucket(StorageBucket bucket) throws ServiceException { return createBucketImpl(bucket.getName(), bucket.getLocation(), bucket.getAcl()); }
/** * Create a bucket with the Access Control List settings of the bucket object (if any). * <p> * <b>Caution:</b> Performing this operation unnecessarily when a bucket already * exists may cause OperationAborted errors with the message "A conflicting conditional * operation is currently in progress against this resource.". To avoid this error, use the * {@link #getOrCreateBucket(String)} in situations where the bucket may already exist. * <p> * This method cannot be performed by anonymous services. * * @param bucket * the bucket to create, including optional ACL settings. * @return * the created bucket object. <b>Note:</b> the object returned has minimal information about * the bucket that was created, including only the bucket's name. * @throws ServiceException */ public StorageBucket createBucket(StorageBucket bucket) throws ServiceException { return createBucketImpl(bucket.getName(), bucket.getLocation(), bucket.getAcl()); }