From 769c896e5346f9796b9ef1a2e1cd942ed83bc69c Mon Sep 17 00:00:00 2001 From: dajoropo Date: Mon, 22 Jun 2020 12:05:11 +0200 Subject: [PATCH] Added method to created Stateful clients ( #268). (#603) Co-authored-by: Daniel Rodriguez --- src/main/java/net/schmizz/sshj/SSHClient.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/net/schmizz/sshj/SSHClient.java b/src/main/java/net/schmizz/sshj/SSHClient.java index e89897c42..1fb3b9952 100644 --- a/src/main/java/net/schmizz/sshj/SSHClient.java +++ b/src/main/java/net/schmizz/sshj/SSHClient.java @@ -722,6 +722,19 @@ public SFTPClient newSFTPClient() return new SFTPClient(new SFTPEngine(this).init()); } + /** + * Stateful FTP client is required in order to connect to Serv-U FTP servers. + * @return Instantiated {@link SFTPClient} implementation. + * + * @throws IOException if there is an error starting the {@code sftp} subsystem + */ + public SFTPClient newStatefulSFTPClient() + throws IOException { + checkConnected(); + checkAuthenticated(); + return new StatefulSFTPClient(new SFTPEngine(this).init()); + } + /** * Does key re-exchange. *