You can use this webscript to get list.(inbuilt webscript)
You can create custom webscript to list folder.
Just put in Alfresco Share Search. For documents:
SITE:"shortsitename" and TYPE:"cm:content"
SITE:"shortsitename" and TYPE:"cm:folder"
The number of documents or folders is shown in the first page of the results of the search. You can use only TYPE: if you select SITE context in Alfresco Search or selecting site facet.
You can use REST API too:
With this web script, i'm only getting count of folders in document library not their sub folders, I need to get the sub-folders count also included, sorry din't mention it before.
The result of document count using the webscript you have sent me is showing max 1000 counts only, is there any way to get the correct count(i.e more than 1000).
The sites with under 1000 document is showing correct count.
How can one use this api in java code, I have similar kind of requirement and I tried calling this api through the code but could not achieve this due to authentication issue(401 error).