Is there any way to find if resource exists using Java-script use api? | Community
Skip to main content
Raghava_Joijode
May 31, 2017
Solved

Is there any way to find if resource exists using Java-script use api?

  • May 31, 2017
  • 2 replies
  • 6372 views

Hi All,

In java use API I can resolve a path(String) to resource and know if that resource exits or not. But in java-script use API, I am able to convert a path(String) to resource using  (granite.resource.resolve(path)) but how can I know if the string path which I converted to a resource exists in my JCR?

Thanks in Advance!!

-Raghava.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Feike_Visser1

Do getResource() instead of resolve(), if it results in null then it doesn't exists.

2 replies

cquser1
May 31, 2017

Hi,

Not pretty sure, but guess you might have to make use of normal java code which uses WCMUSEPojo.

You can await inputs from other community members too on this.

Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
May 31, 2017

Do getResource() instead of resolve(), if it results in null then it doesn't exists.