code: protected CmsFolder convertResourceToFolder(CmsResource resource) throws CmsVfsResourceNotFoundException {
  
          if (resource.isFolder()) {
              return new CmsFolder(resource);
          }
  
          throw new CmsVfsResourceNotFoundException(
              Messages.get().container(Messages.ERR_ACCESS_FILE_AS_FOLDER_1, resource.getRootPath()));
      }
docs: Converts a resource to a folder (if possible).<p>
  
  @param resource the resource to convert
  @return the converted resource
  
  @throws CmsVfsResourceNotFoundException if the resource is not a folder