Node count in its parent folder.

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

Node count in its parent folder.

Hi,

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()) {
                fileCount++;
            }
        }
```
Means, it shuold have node count of folder always whether we are uploading a file or not.
can you just suggest me ?