code: protected CmsVfsEntryBean makeEntryBean(CmsResource resource, boolean root) throws CmsException {
  
          CmsObject cms = getCmsObject();
          boolean isFolder = resource.isFolder();
          String name = root ? "/" : resource.getName();
          String path = cms.getSitePath(resource);
          boolean hasChildren = false;
          if (isFolder) {
              List<CmsResource> children = cms.getResourcesInFolder(
                  cms.getRequestContext().getSitePath(resource),
                  CmsResourceFilter.DEFAULT);
              if (!children.isEmpty()) {
                  hasChildren = true;
              }
          }
          String resourceType = OpenCms.getResourceManager().getResourceType(resource.getTypeId()).getTypeName();
  
          return new CmsVfsEntryBean(path, name, resourceType, isFolder, hasChildren);
      }
docs: Helper method for creating a VFS entry bean from a resource.<p>
  
  @param resource the resource whose data should be stored in the bean
  @param root true if the resource is a root resource
  
  @return the data bean representing the resource
  
  @throws CmsException if something goes wrong