Highlighted

Storing DOMSource XML to Node Using JcrUtils.putFile method

mahabubali

05-03-2019

Hello Community,

I have a requirement of storing XML file created by POJO using Java DOM API(javax.xml.transform.dom.DOMSource) to a Node in JCR repository. I would like to use, JcrUtils.putFile(currentNode, "fileName.xml", "application/xml", fileInputStream);

But I am unable to convert the DOMSource or StreamResult to FileInputStream, to pass on to JcrUtils.putFile method. Could you please suggest any ideas?

Any other approaches to complete this problem are also welcome.

I thank you in advance.

-Mahabub Ali Mohammad.

Replies

Highlighted

PuzanovsP

MVP

05-03-2019

Dear Mohammad,

Not entirely sure why you want to use JCRUtils,

Transform your DOMSource into a String and store string via ModifiableValueMap and you are done;

Regards,

Peter