JClouds 1.5 to 1.6 upgrade - org.jclouds.blobstore.BlobStoreContextFactory class no longer exists

StackOverflow https://stackoverflow.com/questions/17567419

  •  02-06-2022
  •  | 
  •  

Question

Upgrading jclouds from 1.5 to 1.6 and the class BlobStoreContextFactory is no removed

We used to have some unit test code with

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

But it can't compile anymore.

[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

I could not find any migration guide etc from the 1.6.0 release notes from: http://jclouds.incubator.apache.org/documentation/releasenotes/1.6/

Any pointers how to create a BlobStoreContext without the factory or some other way?

Was it helpful?

Solution

Found the answer. There is a new ContextBuilder API to be used.

BlobStore blobStore = ContextBuilder.newBuilder("transient").credentials("identity", "credential")
                          .buildView(BlobStoreContext.class).getBlobStore();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top