1 2 29 30 package com.jcraft.jsch; 31 32 public class RequestSftp extends Request{ 33 RequestSftp(){ 34 setReply(true); 35 } 36 public void request(Session session, Channel channel) throws Exception { 37 super.request(session, channel); 38 39 Buffer buf=new Buffer(); 40 Packet packet=new Packet(buf); 41 packet.reset(); 42 buf.putByte((byte)Session.SSH_MSG_CHANNEL_REQUEST); 43 buf.putInt(channel.getRecipient()); 44 buf.putString("subsystem".getBytes()); 45 buf.putByte((byte)(waitForReply() ? 1 : 0)); 46 buf.putString("sftp".getBytes()); 47 write(packet); 48 } 49 } 50 | Popular Tags |