code: public static String getRelativeParent(String path, int level, boolean ignoreTrailingSlash)
     {
        if (ignoreTrailingSlash && path.endsWith("/") && path.length() > 1)
        {
           path = path.substring(0, path.length() - 1);
        }
        return getRelativeParent(path, level);
     }
docs: Same as {@link #getRelativeParent(String, int)} but adding the possibility to pass paths that
  end with a trailing '/'.
  
  @see #getRelativeParent(String, int)
  @param path
  path
  @param level
  level
  @param ignoreTrailingSlash
  ignore trailing slash
  @return String relative parent