class AcmFolderServiceImpl implements AcmFolderService, ApplicationEventPublisherAware {

    void findFolderChildren(AcmFolder folder, Set<EcmFile> childFiles, Set<AcmFolder> childFolders)
    {
        if (folder == null)
        {
            return;
        }

        childFiles.addAll(fileDao.findByFolderId(folder.getId()));

        for (AcmFolder childFolder : folder.getChildrenFolders())
        {
            childFolders.add(childFolder);
            findFolderChildren(childFolder, childFiles, childFolders);
        }
    }

}