Check if file exists in DAM or Site admin of Adobe Experience Manager | Community
Skip to main content
October 5, 2017
Solved

Check if file exists in DAM or Site admin of Adobe Experience Manager

  • October 5, 2017
  • 4 replies
  • 4363 views

Hi everyone,

Is there an efficient way to check if a file/resource exists in the system?

Thank you!

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 smacdonald2008

You can use this API to see if a resource exists a specific location:

Resource res = resourceResolver.getResource(location);

4 replies

Himanshu_Singhal
Community Advisor
Community Advisor
October 6, 2017

Hi,

To check if the resource exists in JCR, you can use ResourceUtil API.

ResourceUtil ("The Adobe AEM Quickstart and Web Application.")

Regards

Himanshu

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 6, 2017

You can use this API to see if a resource exists a specific location:

Resource res = resourceResolver.getResource(location);

Singaiah_Chintalapudi
Level 7
October 6, 2017

You can use the Sling API as Scott mentioned.

halinggAuthor
February 24, 2018

Is there a way to do this using a curl command?

Thank you for helping!