code: public String getRootPath(Page page) {
      if (page == null) {
        return null;
      }
      return getRootPath(page.adaptTo(Resource.class));
    }
docs: Gets site root level path of a site.
  @param page CQ Page of site
  @return Site root path for the site. The path is not checked for validness.