Expand my Community achievements bar.

SOLVED

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

Avatar

Level 1

Hi everyone,

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

Thank you!

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

Resource res = resourceResolver.getResource(location);

View solution in original post

4 Replies

Avatar

Community Advisor

Hi,

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

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

Regards

Himanshu

Avatar

Correct answer by
Level 10

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

Resource res = resourceResolver.getResource(location);

Avatar

Community Advisor

You can use the Sling API as Scott mentioned.

Avatar

Level 1

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

Thank you for helping!