Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Storing DOMSource XML to Node Using JcrUtils.putFile method

Avatar

Avatar
Level 1
mahabubali
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
mahabubali
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
mahabubali
Level 1

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

Avatar

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

135 likes

Total Posts

541 posts

Correct Reply

164 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

135 likes

Total Posts

541 posts

Correct Reply

164 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile
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