My first post. Few hours ago my customer told me to sFTP a file instead of
ftp.
I stumbled upon Jsch library and wrote the following code
private void sftpToDestination() throws JSchException, SftpException
{
JSch jsch = new JSch();
Session session = jsch.getSession(sftpUser, sftpAddress, sftpPort);
session.connect();
Channel channel = session.openChannel("sftp");
channel.connect();
ChannelSftp c = (ChannelSftp) channel;
c.put("export.zip", "export.zip");
channel.disconnect();
session.disconnect();
}
Everything is fine except that I wonder where do I pass the password to
establish a connection. Or does sFTP use something else instead of a
password which I am missing here.
I don't know much about sFTP protocol or Jsch
------------------------------------------------------------------------------
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users