code: public static String parentPath(String p) {
          if (p == null || URIUtils.SLASH.equals(p))
              return null;
          int slash = p.lastIndexOf('/', p.length() - 2);
          if (slash >= 0)
              return p.substring(0, slash + 1);
          return null;
      }
docs: Return the parent Path.
  Treat a URI like a directory path and return the parent directory.
  
  @param p the path to return a parent reference to
  @return the parent path of the URI