cancel
Showing results for 
Search instead for 
Did you mean: 

calculate the number of files and sub-folders of a folder

ayushi_agrahari
Confirmed Champ
Confirmed Champ

I am trying https://github.com/zhihailiu/alfresco-folder-size to calculate the size of folder in alfresco,it is working fine for calculating the size of folder but I also want to calculate the number of sub folders and files in the folder.any guidance regarding this would be highly appreciated

1 REPLY 1

kalpesh_c2
Star Collaborator
Star Collaborator

Hello Ayushi Agrahatri,

      By using java api you can calculate the subfolders.

List<FileInfo> children = serviceRegistry.getFileFolderService().listFolders(src);
int subfoldersize = children.size();

Thanks,

Kalpesh

ContCentric