I'm confused... I am using com/hierynomus/sshj SFTP-lib and following code gives me ClassCastException:
SSHClient ssh = new SSHClient();
//... connect etc
StatefulSFTPClient client = (StatefulSFTPClient) ssh.newSFTPClient();
I need the StatefulSFTPClient but I don't know how to use it... Do I need to extend the SSHClient class with:
public StatefulSFTPClient newStatefulSFTPClient()
throws IOException {
checkConnected();
checkAuthenticated();
return new StatefulSFTPClient(new SFTPEngine(this).init());
}