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