### Question:
JSchUtils { public static void sftpPut(Session session, InputStream input, String targetFile) { ChannelSftp channel = null; try { channel = (ChannelSftp) session.openChannel("sftp"); channel.connect(); channel.put(input, targetFile, ChannelSftp.OVERWRITE); channel.quit(); } catch (JSchException e) { throw new AutoException("ECOMMON-000304", e); } catch (SftpException e) { throw new AutoException("ECOMMON-000304", e); } finally { if (channel != null) { channel.disconnect(); } } } private  JSchUtils(); static Session createSession(String username, String password, String host); static Session createSession(String username, String password, String host, int port); static Session createSessionByPrivateKey(String username, String privateKey, String host); static Session createSessionByPrivateKey(String username, String privateKey, String passphrase,
            String host); static Session createSessionByPrivateKey(String username, String privateKey, String host, int port); static Session createSessionByPrivateKey(String username, String privateKey, String passphrase, String host,
            int port); static JSchResult executeCommand(Session session, String command); static JSchResult executeCommand(Session session, String command, String encoding); static JSchResult executeCommand(Session session, String command, long timeout); static JSchResult executeCommand(Session session, String command, String encoding, long timeout); static JSchResult executeCommand(Session session, String command, String encoding, long timeout,
            boolean pty); static void sftpPut(Session session, InputStream input, String targetFile);  }### Answer:
@Test @Ignore public void testSftpPut() throws Exception { Session session = JSchUtils.createSession("user01", "passw0rd", "172.22.0.23"); ByteArrayInputStream input = new ByteArrayInputStream("abcde".getBytes()); JSchUtils.sftpPut(session, input, "/home/user01/test"); session.disconnect(); }