code: public void initialize() throws SshException, UnsupportedEncodingException {
  
  		// Initialize the SFTP subsystem
  		try {
  
  			Packet packet = createPacket();
  			packet.write(SSH_FXP_INIT);
  			packet.writeInt(this_MAX_VERSION);
  
  			sendMessage(packet);
  
  			byte[] msg = nextMessage();
  
  			if (msg[0] != SSH_FXP_VERSION) {
  				close();
  				throw new SshException(
  						"Unexpected response from SFTP subsystem.",
  						SshException.CHANNEL_FAILURE);
  			}
  
  			ByteArrayReader bar = new ByteArrayReader(msg);
  
  			try {
  				bar.skip(1);
  
  				serverVersion = (int) bar.readInt();
  				version = Math.min(serverVersion, MAX_VERSION);
  				try {
  					while (bar.available() > 0) {
  						String name = bar.readString();
  						byte[] data = bar.readBinaryString();
  
  						extensions.put(name, data);
  					}
  				} catch (Throwable t) {
  				}
  			} finally {
  				bar.close();
  			}
  
  			if (version <= 3)
  				setCharsetEncoding("ISO-8859-1");
  			else
  				setCharsetEncoding("UTF8");
  		} catch (SshIOException ex) {
  			throw ex.getRealException();
  		} catch (IOException ex) {
  			throw new SshException(SshException.CHANNEL_FAILURE, ex);
  		} catch (Throwable t) {
  			throw new SshException(SshException.CHANNEL_FAILURE, t);
  		}
  
  	}
docs: Initializes the sftp subsystem and negotiates a version with the server.
  This method must be the first method called after the channel has been
  opened. This implementation current supports SFTP protocol version 4 and
  below.
  
  @throws SshException
  @throws UnsupportedEncodingException