code: public static String getCategoryPath(String rootPath, String baseFolder) throws CmsException {
  
          String base;
          if (rootPath.startsWith(CmsCategoryService.CENTRALIZED_REPOSITORY)) {
              base = CmsCategoryService.CENTRALIZED_REPOSITORY;
          } else {
              base = baseFolder;
              if (!base.endsWith("/")) {
                  base += "/";
              }
              if (!base.startsWith("/")) {
                  base = "/" + base;
              }
              int pos = rootPath.indexOf(base);
              if (pos < 0) {
                  throw new CmsDataAccessException(
                      Messages.get().container(Messages.ERR_CATEGORY_INVALID_LOCATION_1, rootPath));
              }
              base = rootPath.substring(0, pos + base.length());
          }
          return rootPath.substring(base.length());
      }
docs: Returns the category path for the given root path.<p>
  
  @param rootPath the root path
  @param baseFolder the categories base folder name
  
  @return the category path
  
  @throws CmsException if the root path does not match the given base folder