How to convert jcr:data to readable text. | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Sep 2, 2022 7:08 AM UTC

Hi,

You can read the data without subservice if user has access to that node.

Although you need jcrsession or resourceresolver to read the node.you can get this from request object.

 

Display binary data in readable fromat is totally depends on what kind of data is stored in the node. if it is json you can see but if the format is something else then you need those applications to see that data in readable format

Arun Patidar

4 replies

Employee
Sep 2, 2022 11:30 AM UTC

Hi @akshaybhujbale ,

 

You can try below snippet

 

ValueMap properties = currentPage.getProperties();
data = IOUtils.toString(properties.get(“jcr:data”, InputStream.class), “UTF-8”);

Hope this helps!!

 

Thanks

 

Translate
arunpatidar
New Participant
Sep 1, 2022 3:06 PM UTC
Level 6
Sep 2, 2022 6:01 AM UTC

HI @arunpatidar Thanks

Is there any to get this without resourceresolver.

Is there any way to encode the binary data to readable text.

Translate
arunpatidar
arunpatidarAccepted solution
New Participant
Sep 2, 2022 7:08 AM UTC

Hi,

You can read the data without subservice if user has access to that node.

Although you need jcrsession or resourceresolver to read the node.you can get this from request object.

 

Display binary data in readable fromat is totally depends on what kind of data is stored in the node. if it is json you can see but if the format is something else then you need those applications to see that data in readable format

Translate
Arun Patidar