Authorization Exception while trying to connect to swift

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

anonymous user


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 = "";

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" command: GET HTTP/1.1 failed with response: HTTP/1.1 401 Unauthorized; content: [


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


Please suggest.

edit retag flag offensive close merge delete