@Override
  public PathImpl getParent()
  {
    if (_pathname.length() <= 1)
      return lookup("/");

    int length = _pathname.length();
    int lastSlash = _pathname.lastIndexOf('/');

    if (lastSlash < 1)
      return lookup("/");

    if (lastSlash == length - 1) {
      lastSlash = _pathname.lastIndexOf('/', length - 2);
      if (lastSlash < 1)
        return lookup("/");
    }

    return lookup(_pathname.substring(0, lastSlash));
  }
@ Override public PathImpl getParent ( ) { if ( _pathname . length ( ) <= 1 ) return lookup ( "/" ) ; int length = _pathname . length ( ) ; int lastSlash = _pathname . lastIndexOf ( '/' ) ; if ( lastSlash < 1 ) return lookup ( "/" ) ; if ( lastSlash == length - 1 ) { lastSlash = _pathname . lastIndexOf ( '/' , length - 2 ) ; if ( lastSlash < 1 ) return lookup ( "/" ) ; } return lookup ( _pathname . substring ( 0 , lastSlash ) ) ; }
Return the parent Path