RestObject tempCabinet = client.getCabinet(ms_link); // "Temp");
Map<String, Object> o = new HashMap<String, Object>();
o.put("object_name", ms_filename);
o.put("u_doc_flag","9");
o.put("a_content_type", contentFormat);
o.put("a_storage_type", ms_storage); // this line make null exception in uploadDistributedContent
RestObject newObjectWithoutContent = new PlainRestObject("dm_document", o);
RestObject created =
client.createDocument(tempCabinet, (RestObject)newObjectWithoutContent, (Object)null, null,
"require-dc-write", "true",
"format", "crtext",
"content-length", "" + target_file.length(),
"network-location", netloc,
);
String s = created.getHref(LinkRelation.DISTRIBUTED_UPLOAD);
client.uploadDistributedContent(created.getHref(LinkRelation.DISTRIBUTED_UPLOAD), new FileInputStream(target_file));