code: public FilePath getParent() {
          int i = remote.length() - 2;
          for (; i >= 0; i--) {
              char ch = remote.charAt(i);
              if(ch=='\\' || ch=='/')
                  break;
          }
  
          return i >= 0 ? new FilePath( channel, remote.substring(0,i+1) ) : null;
      }
docs: Gets the parent file.
  @return parent FilePath or null if there is no parent