Authorization Exception while trying to connect to swift

asked 2015-03-12 02:59:54 -0500

anonymous user

Anonymous

I am trying to execute following program and getting below exception.

public static void main(String[] args) { // TODO Auto-generated method stub String provider = "swift"; String identity = "aerius:aerius"; // Your DreamObjects user and sub-user String password = "aerius"; // Your DreamObjects secret key String auth_url = "http://aeriustest.qfund.net/auth";

BlobStoreContext context = ContextBuilder.newBuilder(provider) .endpoint(auth_url) .credentials(identity, password) .buildView(BlobStoreContext.class);

BlobStore blobStore = context.getBlobStore();

for (StorageMetadata resourceMd : blobStore.list()) { System.out.println(resourceMd.getName()); }

blobStore.createContainerInLocation(null, "my-new-container");

PageSet objects = blobStore.list("aeriuscontainer"); for (StorageMetadata resourceMd : objects) { System.out.println(resourceMd.getName()); } // Close the connection after completing all operations! context.close();

}

Exception in thread "main" org.jclouds.rest.AuthorizationException: command: GET http://aeriustest.qfund.net/auth/v1.0 HTTP/1.1 failed with response: HTTP/1.1 401 Unauthorized; content: [

Unauthorized

This server could not verify that you are authorized to access the document you requested.

</html>]

Please suggest.

edit retag flag offensive close merge delete