本文整理汇总了Java中org.jclouds.blobstore.BlobStore.deleteContainer方法的典型用法代码示例。如果您正苦于以下问题:Java BlobStore.deleteContainer方法的具体用法?Java BlobStore.deleteContainer怎么用?Java BlobStore.deleteContainer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jclouds.blobstore.BlobStore
的用法示例。
在下文中一共展示了BlobStore.deleteContainer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tearDown
import org.jclouds.blobstore.BlobStore; //导入方法依赖的package包/类
@After
public void tearDown() throws Exception {
BlobStore blobStore = app.getBlobStore();
if (blobStore != null) {
blobStore.deleteContainer(containerName);
}
if (blobStore != null && blobStore.getContext() != null) {
blobStore.getContext().close();
}
app.stop();
}
示例2: deleteContainer
import org.jclouds.blobstore.BlobStore; //导入方法依赖的package包/类
/**
* Delete a {@link BlobStore} specific container
*/
public static void deleteContainer(BlobStore blobStore, String container) throws IOException {
blobStore.deleteContainer(container);
}
示例3: main
import org.jclouds.blobstore.BlobStore; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
Options options = new Options();
CmdLineParser parser = new CmdLineParser(options);
try {
parser.parseArgument(args);
} catch (CmdLineException cle) {
PrintStream err = System.err;
err.println("are-we-consistent-yet version " +
AreWeConsistentYet.class.getPackage()
.getImplementationVersion());
err.println("Usage: are-we-consistent-yet" +
" --container-name NAME --properties FILE [options...]");
parser.printUsage(err);
System.exit(1);
}
Properties properties = new Properties();
try (InputStream is = new FileInputStream(options.propertiesFile)) {
properties.load(is);
}
Properties propertiesRead = (Properties) properties.clone();
if (options.readerEndpoint != null) {
propertiesRead.setProperty(Constants.PROPERTY_ENDPOINT,
options.readerEndpoint);
}
try (BlobStoreContext context = blobStoreContextFromProperties(
properties);
BlobStoreContext contextRead = blobStoreContextFromProperties(
propertiesRead)) {
BlobStore blobStore = context.getBlobStore();
BlobStore blobStoreRead = contextRead.getBlobStore();
Location location = null;
if (options.location != null) {
for (Location loc : blobStore.listAssignableLocations()) {
if (loc.getId().equalsIgnoreCase(options.location)) {
location = loc;
break;
}
}
if (location == null) {
throw new Exception("Could not find location: " +
options.location);
}
}
blobStore.createContainerInLocation(location,
options.containerName);
AreWeConsistentYet test = new AreWeConsistentYet(
blobStore, blobStoreRead, options.containerName,
options.iterations, options.objectSize);
PrintStream out = System.out;
out.println("eventual consistency count with " +
options.iterations + " iterations: ");
out.println("read after create: " + test.readAfterCreate());
out.println("read after delete: " + test.readAfterDelete());
out.println("read after overwrite: " + test.readAfterOverwrite());
out.println("list after create: " + test.listAfterCreate());
out.println("list after delete: " + test.listAfterDelete());
blobStore.deleteContainer(options.containerName);
}
}