本文整理了Java中com.google.cloud.storage.Bucket.delete()
方法的一些代码示例,展示了Bucket.delete()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bucket.delete()
方法的具体详情如下:
包路径:com.google.cloud.storage.Bucket
类名称:Bucket
方法名:delete
[英]Deletes this bucket.
Example of deleting the bucket, if its metageneration matches the Bucket#getMetageneration() value, otherwise a StorageException is thrown.
boolean deleted = bucket.delete(BucketSourceOption.metagenerationMatch());else
// the bucket was not found
}
}
[中]删除此存储桶。
删除bucket的示例,如果其元生成与bucket#getMetageneration()值匹配,则抛出StorageException。
boolean deleted = bucket.delete(BucketSourceOption.metagenerationMatch());else
// the bucket was not found
}
}
代码示例来源:origin: googleapis/google-cloud-java
/**
* Example of deleting the bucket, if its metageneration matches the {@link
* Bucket#getMetageneration()} value, otherwise a {@link StorageException} is thrown.
*/
// [TARGET delete(BucketSourceOption...)]
public boolean delete() {
// [START delete]
boolean deleted = bucket.delete(BucketSourceOption.metagenerationMatch());
if (deleted) {
// the bucket was deleted
} else {
// the bucket was not found
}
// [END delete]
return deleted;
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testDelete() throws Exception {
initializeExpectedBucket(4);
expect(storage.getOptions()).andReturn(mockOptions);
expect(storage.delete(BUCKET_INFO.getName())).andReturn(true);
replay(storage);
initializeBucket();
assertTrue(bucket.delete());
}
代码示例来源:origin: io.konig/konig-gcp-common
private void deleteBucket(Bucket bucket) {
if (bucket != null) {
Page<Blob> page = bucket.list();
for (Blob blob : page.iterateAll()) {
blob.delete();
}
bucket.delete();
}
}
内容来源于网络,如有侵权,请联系作者删除!