Skip to content

Instantly share code, notes, and snippets.

@VenkataA
Created August 7, 2023 22:15
Show Gist options
  • Save VenkataA/ea343b118d4ee1e0f0c4160bff985a1f to your computer and use it in GitHub Desktop.
Save VenkataA/ea343b118d4ee1e0f0c4160bff985a1f to your computer and use it in GitHub Desktop.
AEM Read Node Contents via ECMAScript
var path = "/var/tsa/intake_counter.json";
var jcrsession = graniteWorkflowSession.adaptTo(Packages.javax.jcr.Session);
var node = jcrsession.getNode(path);
var is = node.getNode("jcr:content").getProperty("jcr:data").getStream();
var jsonInputString = org.apache.commons.io.IOUtils.toString(is, "UTF-8");
is.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment