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

cancel
Showing results for 
Search instead for 
Did you mean: 
ayushi_agrahari
Active Member II

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

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
kalpesh_c2
Senior Member

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

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