Implemented the ability to set the connection timeout.
A good part of the code already existed, it was just
commented out.
Attaching three files with the changes.
To properly set the connection timeout:
the setConnectTimeout method must be called before
the connect method.
<code snippet>
sshClient = new SshClient();
// Set connect timeout for 10 seconds
shClient.setConnectTimeout(10000);
if (source.getFtpPort() == null || source.getFtpPort
().length() == 0) {
sshClient.connect(ipAddr, new
IgnoreHostKeyVerification());
} else {
sshClient.connect(ipAddr, Integer.parseInt
(source.getFtpPort()), new IgnoreHostKeyVerification());
}
3 Modified files for ConnectTimeout