本文整理了Java中com.google.cloud.storage.Bucket.getDefaultAcl()
方法的一些代码示例,展示了Bucket.getDefaultAcl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bucket.getDefaultAcl()
方法的具体详情如下:
包路径:com.google.cloud.storage.Bucket
类名称:Bucket
方法名:getDefaultAcl
[英]Returns the default object ACL entry for the specified entity on this bucket or null if not found.
Default ACLs are applied to a new blob within the bucket when no ACL was provided for that blob.
Example of getting the default ACL entry for an entity.
Acl acl = bucket.getDefaultAcl(User.ofAllAuthenticatedUsers());
[中]返回此bucket上指定实体的默认对象ACL条目,如果未找到,则返回null。
当没有为该blob提供ACL时,默认ACL将应用于bucket中的新blob。
获取实体的默认ACL条目的示例。
Acl acl = bucket.getDefaultAcl(User.ofAllAuthenticatedUsers());
代码示例来源:origin: googleapis/google-cloud-java
/** Example of getting the default ACL entry for an entity. */
// [TARGET getDefaultAcl(Entity)]
public Acl getDefaultAcl() {
// [START getDefaultAcl]
Acl acl = bucket.getDefaultAcl(User.ofAllAuthenticatedUsers());
// [END getDefaultAcl]
return acl;
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testGetDefaultAcl() throws Exception {
initializeExpectedBucket(4);
expect(storage.getOptions()).andReturn(mockOptions);
expect(storage.getDefaultAcl(BUCKET_INFO.getName(), User.ofAllAuthenticatedUsers()))
.andReturn(ACL);
replay(storage);
initializeBucket();
assertEquals(ACL, bucket.getDefaultAcl(User.ofAllAuthenticatedUsers()));
}
代码示例来源:origin: googleapis/google-cloud-java
assertEquals(CREATE_TIME, bucket.getCreateTime());
assertEquals(CORS, bucket.getCors());
assertEquals(DEFAULT_ACL, bucket.getDefaultAcl());
assertEquals(DELETE_RULES, bucket.getDeleteRules());
assertEquals(LIFECYCLE_RULES, bucket.getLifecycleRules());
内容来源于网络,如有侵权,请联系作者删除!