code: public static int getAbsoluteLevel(@NotNull String path, @NotNull ResourceResolver resourceResolver) {
      if (StringUtils.isEmpty(path) || StringUtils.equals(path, "/")) {
        return -1;
      }
      String originalPath = getOriginalPath(path, resourceResolver);
      return StringUtils.countMatches(originalPath, "/") - 1;
    }
docs: Gets level from parent use same logic (but reverse) as {@link #getAbsoluteParent(Page, int, ResourceResolver)}.
  If the path is a version history or launch path the original path is returned.
  @param path Path
  @param resourceResolver Resource resolver
  @return level &gt;= 0 if path is valid, -1 if path is invalid