How to capture ssh.connect("host") & ssh.authPassword("username", "password"); exit codes whether it is success or not..
- Dominant language
- Java
- Stars
- 2.7k
- Forks
- 620
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 11
Description
I am following the below code to connect SFTP to put the file there..
How to capture ..SSHClient ssh = new SSHClient(); AND ssh.authPassword("username", "password"); commands exit codes?
my requirement is periodically check SFTP connection between source server to destination server.. I think we can create boolean variable as flag and assign the exit code to that flag (True or False).. Could you please suggest me?
ssh.connect("host");
try {
ssh.authPassword("username", "password");
SFTPClient sftp = ssh.newSFTPClient();
try {
sftp.put(new FileSystemFile("/path/of/local/file"), "/path/of/ftp/file");
} finally {
sftp.close();
}
} finally {
ssh.disconnect();
}
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.