docs: protected void setLink(CmsObject cms, String resourcePath) {
  
          String link = resourcePath;
          try {
              // make sure the res is a folder
              cms.readFolder(resourcePath);
  
              // adjust the path
              if (resourcePath.endsWith(CmsToolManager.TOOLPATH_SEPARATOR)) {
                  resourcePath = resourcePath.substring(0, resourcePath.lastIndexOf(CmsToolManager.TOOLPATH_SEPARATOR));
              }
  
              // set admin page as link
              link = CmsToolManager.VIEW_JSPPAGE_LOCATION;
  
              // try to use the folder default file as link
              CmsProperty prop = cms.readPropertyObject(resourcePath, CmsPropertyDefinition.PROPERTY_DEFAULT_FILE, false);
              String defFile = "index.jsp";
              if (!prop.isNullProperty()) {
                  defFile = prop.getValue();
              }
              if (!defFile.startsWith(CmsToolManager.TOOLPATH_SEPARATOR)) {
                  // try to use this relative link
                  defFile = resourcePath + CmsToolManager.TOOLPATH_SEPARATOR + defFile;
              }
              if (defFile.indexOf("?") > 0) {
                  if (cms.existsResource(defFile.substring(0, defFile.indexOf("?")))) {
                      link = defFile;
                  }
              } else if (cms.existsResource(defFile)) {
                  link = defFile;
              }
          } catch (CmsException e) {
              // not a folder or no default file, ignore
          }
  
          setLink(link);
      }