JClouds 1.5到1.6升级 - org.jclouds.blobstore.BlobStoreContextFactory类不再存在

时间:2013-07-10 09:45:06

标签: jclouds

将jclouds从1.5升级到1.6并且类BlobStoreContextFactory未被删除

我们曾经有一些单位测试代码

    BlobStoreContextFactory contextFactory = new BlobStoreContextFactory();
    BlobStoreContext blobStoreContext = contextFactory.createContext("transient", "identity", "credential");

但它不能再编译了。

[ERROR] /Users/davsclaus/workspace/camel/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jclouds/BlobStoreBlueprintRouteTest.java:[27,28] error: cannot find symbol
[ERROR] symbol:   class BlobStoreContextFactory
[ERROR] location: package org.jclouds.blobstore

我找不到来自http://jclouds.incubator.apache.org/documentation/releasenotes/1.6/

的1.6.0发行说明中的​​任何迁移指南等

如何在没有工厂或其他方式的情况下创建BlobStoreContext的任何指示?

1 个答案:

答案 0 :(得分:1)

找到答案。有一个新的ContextBuilder API可供使用。

BlobStore blobStore = ContextBuilder.newBuilder("transient").credentials("identity", "credential")
                          .buildView(BlobStoreContext.class).getBlobStore();