Hi
We are using JSch apis for SFTP access.
In our current project we want to differentiate between normal login failure due to invalid credentials and login failure due to account has been locked.
Can someone suggest how to do ? Below is our code snippet
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
public Session getSFTPSession(String userID, String password, int port,
String hostIP) throws IBPPException {
LOGGER.info("In getFtpSession");
JSch jsch = new JSch();
Session sftpSession = null;
try {
sftpSession = jsch.getSession(userID, hostIP, port);
LOGGER.info("sftpSession" + sftpSession);
sftpSession.setPassword(password);
Properties config = new Properties();
config.put("StrictHostKeyChecking", "no");
sftpSession.setConfig(config);
sftpSession.setTimeout(10 * 60 * 1000);
sftpSession.connect();
LOGGER.info("SFT connection open");
} catch (JSchException jsche) {
LOGGER.info("Error creating SFTP session. Exception is "
+ jsche.getMessage());
throw new BusinessException(ExceptionConstants.INVALID_LOGON,
CLASS_NAME, "getSFTPSession");
}
return sftpSession;
}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<