Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Invalid
-
2.0.0
-
None
-
RHEL 7
Java 1.7
Description
Checking container exist before container creation for the very first time followed by getBlob fails saying
Exception in thread "main" java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
at com.google.common.base.Absent.get(Absent.java:47)
at org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.toBlobMetadata(RegionScopedSwiftBlobStore.java:603)
Getblob fails
at org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.getBlob(RegionScopedSwiftBlobStore.java:381) at org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.getBlob(RegionScopedSwiftBlobStore.java:371) at main.java.s3_19.App.main(App.java:98)
Code Snippet Used:
BlobStoreContext context = ContextBuilder.newBuilder("openstack-swift") .endpoint("http://x.xx.xx.x:5000/v2.0") .credentials("xx:xxx", "xxx") .buildView(BlobStoreContext.class); PutOptions opt = new PutOptions(); opt.multipart(); BlobStore blobStore = context.getBlobStore(); boolean val = blobStore.containerExists(CONTAINER_NAME); blobStore.createContainerInLocation(null, CONTAINER_NAME); Blob blob = blobStore.blobBuilder(OBJECT_NAME) .payload(payload) .build(); blobStore.putBlob(CONTAINER_NAME, blob, opt); Blob b1 = blobStore.getBlob(CONTAINER_NAME, OBJECT_NAME);
For the second time, since the container is already there its successful.