Node count in its parent folder.

Showing results for 
Search instead for 
Did you mean: 
Member II

Node count in its parent folder.


May i know the correct method to get the node count in the parent folder. I have done this


        ChildAssociationRef parent = serviceRegistry.getNodeService().getPrimaryParent(nodeRef);
        final NodeRef fileNodeRef = parent.getChildRef();                                                                
        final FileInfo parentInfo = serviceRegistry.getFileFolderService().getFileInfo(fileNodeRef);
        if(!parentInfo.getType().toString().equals(SYSTEM_FOLDER)) {
            if (!parentInfo.isFolder()) {
Means, it shuold have node count of folder always whether we are uploading a file or not.
can you just suggest me ?