How to use SSHClient as a service #795
Unanswered
guilhemferr
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, we're wrapping the library in a Spring Boot service like the following.
So clients would inject the
SFTPServiceand callconnectwhen they need to talk with the SFTP server. InternallySFTPConnectionprovides some abstraction on top of the library, but mainly it implements a closable interface. So when it is closed we close the current connection and we calldisconnectint he sshClient. I'm wondering what are the best practices to handle connections in the context of a bean? Is there any downside on holding a class instance ofSSHClientalready connected?Beta Was this translation helpful? Give feedback.
All reactions