当前位置: 首页>>代码示例>>Java>>正文


Java BlobStore.deleteContainer方法代码示例

本文整理汇总了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();
}
 
开发者ID:bouncestorage,项目名称:bouncestorage,代码行数:13,代码来源:ConfigTest.java

示例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);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:7,代码来源:JcloudsBlobStoreHelper.java

示例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);
    }
}
 
开发者ID:gaul,项目名称:are-we-consistent-yet,代码行数:63,代码来源:AreWeConsistentYet.java


注:本文中的org.jclouds.blobstore.BlobStore.deleteContainer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。