class Path implements Comparable, Serializable, ObjectInputValidation {

  public Path getParent() {
    String path = uri.getPath();
    int lastSlash = path.lastIndexOf('/');
    int start = startPositionWithoutWindowsDrive(path);
    if ((path.length() == start) ||               // empty path
        (lastSlash == start && path.length() == start+1)) { // at root
      return null;
    }
    String parent;
    if (lastSlash==-1) {
      parent = CUR_DIR;
    } else {
      parent = path.substring(0, lastSlash==start?start+1:lastSlash);
    }
    return new Path(uri.getScheme(), uri.getAuthority(), parent);
  }

  public  Path(String parent, String child);
  public  Path(Path parent, String child);
  public  Path(String parent, Path child);
  public  Path(Path parent, Path child);
  public  Path(String pathString);
  public  Path(URI aUri);
  public  Path(String scheme, String authority, String path);

}