0

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.

  • https://issues.apache.org/jira/browse/JCLOUDS-1064 (thanks for submitting the jira) – zacksh Jan 21 '16 at 19:19
  • Here is stacktrace of the above issue :Null partETag at org.jclouds.blobstore.domain.AutoValue_MultipartPart.(AutoValue_MultipartPart.java:20) at org.jclouds.blobstore.domain.MultipartPart.create(MultipartPart.java:29) at org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.uploadMultipartPart(RegionScopedSwiftBlobStore.java:481) at org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.putMultipartBlob(RegionScopedSwiftBlobStore.java:567) at org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.putBlob(RegionScop – user3718208 Jan 21 '16 at 21:54

0 Answers0