Question
4
Replies
97
Views
Ford Motor Company
Posted: April 20, 2020
Last activity: June 15, 2020
Number of files in a folder
How to count the number of files in a folder ?
***Edited by Moderator Marissa to update Type form Pega Academy to Product****
Hi Nandhini,
You can make use of the File list() method in java to get the count of files in a directory.
Eg:-
java.io.File directoryName = new java.io.File("C:\\SYSTEM\\CUSTOM_DIRECTORY");
int fileCount=directoryName.list().length; --This prop holds the count
oLog.infoForced("No of files Count:-"+fileCount);
This can be used in your Java Step to Let me know if that helps!