code: public void cd(String dir) throws SftpStatusException, SshException {
  		String actual;
  
  		if (dir == null || dir.equals("")) {
  			actual = sftp.getDefaultDirectory();
  		} else {
  			actual = resolveRemotePath(dir);
  			actual = sftp.getAbsolutePath(actual);
  		}
  
  		if (!actual.equals("")) {
  			SftpFileAttributes attr = sftp.getAttributes(actual);
  
  			if (!attr.isDirectory()) {
  				throw new SftpStatusException(
  						SftpStatusException.SSH_FX_FAILURE, dir
  								+ " is not a directory");
  			}
  		}
  
  		if (Log.isDebugEnabled()) {
  			Log.debug(this, "Changing dir from " + cwd + " to "
  					+ (actual.equals("") ? "user default dir" : actual));
  		}
  
  		cwd = actual;
  	}
docs: <p>
  Changes the working directory on the remote server, or the user's default
  directory if <code>null</code> or any empty string is provided as the
  directory path. The user's default directory is typically their home
  directory but is dependent upon server implementation.
  </p>
  
  @param dir
  the new working directory
  
  @throws IOException
  if an IO error occurs or the file does not exist
  @throws SftpStatusException
  @throws SshException