I am trying to jClouds Blobstore API to upload a file in chunks to the openstack-swift. Here is the snippet of the code I am using to upload a file named dom4j-1.6.1.jar in chunks.
blobStore.putBlob("jclouds-example", blob) does work, but if I add multipart (which chunks the file and upload into pieces) to the method, then I get NullPointerException: Null partETag.
ByteSource payload = Files.asByteSource(tempFile);
Blob blob = blobStore.blobBuilder(objectName)
.payload(payload)
.contentDisposition("attachment; filename=dom4j-1.6.1.jar")
.contentMD5(payload.hash(Hashing.md5()))
.contentLength(payload.size())
.contentType(MediaType.OCTET_STREAM.toString())
.build();
System.out.println(blob.getMetadata().getName());
// Upload the Blob
String eTag = blobStore.putBlob("jclouds-example", blob, multipart());
BTW, jclouds current stable version 1.9.2 doesn't support openstack-swift multipart uploads, so I used their nightly build version 2.0.0 , which seems like it supports chunked upload, but unfortunately I am getting null pointer exception. Anyhelp is greatly appreciated.