code: public static CmsVfsEntryBean internalCreateVfsEntryBean(
          CmsObject cms,
          CmsResource resource,
          String title,
          boolean isRoot,
          boolean isEditable,
          List<CmsVfsEntryBean> children,
          boolean isMatch)
      throws CmsException {
  
          String rootPath = resource.getRootPath();
          CmsUUID structureId = resource.getStructureId();
          CmsVfsEntryBean result = new CmsVfsEntryBean(
              rootPath,
              structureId,
              title,
              CmsIconUtil.getIconClasses(CmsIconUtil.getDisplayType(cms, resource), resource.getName(), true),
              isRoot,
              isEditable,
              children,
              isMatch);
          String siteRoot = null;
          if (resource.isFolder()) {
              cms = OpenCms.initCmsObject(cms);
              cms.getRequestContext().setSiteRoot("");
              List<CmsResource> realChildren = cms.getResourcesInFolder(
                  rootPath,
                  CmsResourceFilter.ONLY_VISIBLE_NO_DELETED);
              List<CmsResource> effectiveChildren = new ArrayList<CmsResource>();
              for (CmsResource realChild : realChildren) {
                  if (realChild.isFolder()) {
                      effectiveChildren.add(realChild);
                  }
              }
              if (effectiveChildren.isEmpty()) {
                  result.setChildren(new ArrayList<CmsVfsEntryBean>());
              }
          }
  
          if (OpenCms.getSiteManager().startsWithShared(rootPath)) {
              siteRoot = OpenCms.getSiteManager().getSharedFolder();
          } else {
              String tempSiteRoot = OpenCms.getSiteManager().getSiteRoot(rootPath);
              if (tempSiteRoot != null) {
                  siteRoot = tempSiteRoot;
              } else {
                  siteRoot = "";
              }
          }
          result.setSiteRoot(siteRoot);
          return result;
      }
docs: Creates the VFS entry bean for a resource.<p>
  
  @param cms the CMS context to use
  @param resource the resource for which to create the VFS entry bean
  @param title the title
  @param isRoot true if this is a root entry
  @param isEditable true if this entry is editable
  @param children the children of the entry
  @param isMatch true if the VFS entry bean is a match for the quick search
  
  @return the created VFS entry bean
  @throws CmsException if something goes wrong