使用JSch进行sftp的连接运行状况检查
public boolean checkConnection() throws JSchException { try { JSch jsch = new JSch(); Session session = sch.getSession(username, host); session.setPort(PORT); session.setPassword(password); session.connect(); return true; } catch(Exception ex){ LOG.error("Error while connecting to SFTP", ex); } return false }