Java Google云存储:使用ACL创建bucket

Java Google云存储:使用ACL创建bucket,java,acl,google-cloud-storage,Java,Acl,Google Cloud Storage,我可以创建bucket,但在创建bucket时找不到如何更改其acl。 我希望每个人都能读,但不能写 要创建bucket,请执行以下操作: Storage storage = new Storage(......); storage.buckets().insert(projectName, new Bucket().setName(bucketName)).execute(); 我看到我可以使用: new Bucket().setAcl(List<BucketAccessControl

我可以创建bucket,但在创建bucket时找不到如何更改其acl。
我希望每个人都能读,但不能写

要创建bucket,请执行以下操作:

Storage storage = new Storage(......);
storage.buckets().insert(projectName, new Bucket().setName(bucketName)).execute();
我看到我可以使用:

new Bucket().setAcl(List<BucketAccessControl>)
newbucket().setAcl(列表)
如何使用.setAcl方法


Thx.

我想你要做的是设置桶的温度。这将对上传到bucket的所有新对象应用ACL

为此,您可以使用从
storage.bucket().insert调用返回的操作方法

请查看文档的部分,以获取预定义ACL的列表。在这种情况下,您可能需要使用
publicRead