javaswift / joss

Java library for OpenStack Storage, aka Swift
http://javaswift.org
117 stars 108 forks source link

MD5_CHECKSUM error while uploading a file #194

Open sankalpanand opened 1 year ago

sankalpanand commented 1 year ago

I'm uploading the file like this-

String path = getClass().getClassLoader().getResource("SmallImage.png").getPath();
String name = "SmallImage.png";
StoredObject object = container.getObject(name);
UploadInstructions uploadInstructions = new UploadInstructions(new File(path));
object.uploadObject(uploadInstructions);

The library itself generates the Etag and adds it to the PUT request header. But then I get the MD5_CHECKSUM error when I try to upload. I don't understand why that MD5 checksum is rejected the the server when the library itself is generating the etag.

The workaround of not supplying the etag does not work either since the library mandatorily adds the etag header here in UploadObjectCommandImpl.prepareUpload method.

Please suggest what can be done here to solve this problem.