I need help with connection to SFTP server? Does anybody have working code?
I found something like this
package test.JSch;
import com.jcraft.jsch.*;
public class TestJSch {
public static void main(String args[]) {
JSch jsch = new JSch();
Session session = null;
try {
session = jsch.getSession("USSERNAME", "HOST", 22);
//session.setConfig("StrictHostKeyChecking", "no");
session.setPassword("PASSWORD");
System.out.println("1");
session.connect();
System.out.println("2");
Channel channel = session.openChannel("sftp");
System.out.println("3");
channel.connect();
System.out.println("4");
ChannelSftp sftpChannel = (Channel