code: public String getSiteRoot(String rootPath) {
  
          // add a trailing slash, because the path may be the path of a site root itself
          if (!rootPath.endsWith("/")) {
              rootPath = rootPath + "/";
          }
          // most sites will be below the "/sites/" folder,
          CmsSite site = lookupSitesFolder(rootPath);
          if (site != null) {
              return site.getSiteRoot();
          }
          // look through all folders that are not below "/sites/"
          return lookupAdditionalSite(rootPath);
      }
docs: Returns the site root part for the given resources root path,
  or <code>null</code> if the given resources root path does not match any site root.<p>
  
  The site root returned will have the form:
  <code>/sites/default</code>.<br>
  That means there will a leading, but no trailing slash.<p>
  
  @param rootPath the root path of a resource
  
  @return the site root part of the resources root path,
  or <code>null</code> if the path does not match any site root
  
  @see #getSiteForRootPath(String)