| | |
| | | //返回 |
| | | return new Result(203,null,result.getMsg(),null); |
| | | } |
| | | if (result.getCode()==205){ |
| | | //返回 |
| | | return new Result(202,null,"新增失败,找不到该用户",null); |
| | | } |
| | | } |
| | | } |
| | | System.out.println("未读取到对应的文件"); |
| | |
| | | * 读取内外推送的文件,每30秒读取一次 |
| | | * @return |
| | | */ |
| | | @Scheduled(cron = "*/30 * * * * ?") |
| | | // @Scheduled(cron = "*/30 * * * * ?") |
| | | public static boolean isFTPFileExist() { |
| | | FTPClient ftp = new FTPClient(); |
| | | try { |
| | |
| | | FTPClient ftp = new FTPClient(); |
| | | boolean flag = false; |
| | | try { |
| | | //设置超时时间 |
| | | ftp.setDataTimeout(60000); |
| | | //连接超时为60秒 |
| | | ftp.setConnectTimeout(60000); |
| | | //连接 |
| | | ftp.connect(ftpHost, ftpPort); |
| | | // 登陆 |
| | |
| | | System.out.println("ftp连接失败"); |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if (ftp != null) { |
| | | if (ftp.isConnected()) { |
| | | try { |
| | | ftp.disconnect(); |
| | | } catch (IOException e) { |