Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

File Utility - Find operation; How to retrieve all files in a folder?

Avatar

Level 10

I am using Find operation of FileUtility service to count the number of files present under a given folder.

I can not find the correct Regular Expression to match all files.

The Adobe documentation mentions that * character is default which matches all files/folder within the Directory. However, If I leave * unchanged, I'm getting an error "Incorrect Regular Expression syntax".

I have tried different combinations, nothing seems worked.

Can anyone assist me on this?

Thanks,

Nith

1 Accepted Solution

Avatar

Correct answer by
Level 3
Level 3

Hi,

You can use the following syntax to get the list of all files:-

\w*\.\w*

Yow can alslo go through the following material for details on Regular Expressions:

http://help.adobe.com/en_US/livecycle/9.0/workbenchHelp/help.htm?content=000582.html

Thanks

View solution in original post

2 Replies

Avatar

Correct answer by
Level 3
Level 3

Hi,

You can use the following syntax to get the list of all files:-

\w*\.\w*

Yow can alslo go through the following material for details on Regular Expressions:

http://help.adobe.com/en_US/livecycle/9.0/workbenchHelp/help.htm?content=000582.html

Thanks

Avatar

Level 10

I din't guess that I have to escape DOT(.) character which is important to consider the file extension.

Your RE is correct, and It works perfectly!

Thanks,

Nith