| | |
| | | //private static String fileName = "nsql.json"; |
| | | |
| | | |
| | | //@Scheduled(cron = "*/30 * * * * ?") |
| | | @Scheduled(cron = "*/30 * * * * ?") |
| | | public static boolean isFTPFileExist() { |
| | | |
| | | FTPClient ftp = new FTPClient(); |
| | |
| | | for (FTPFile file : files){ |
| | | String fileName = file.getName(); |
| | | InputStream is = ftp.retrieveFileStream(new String(fileName.getBytes("GBK"), FTP.DEFAULT_CONTROL_ENCODING)); |
| | | if (null==is){ |
| | | return false; |
| | | }else { |
| | | String substring1 = fileName.substring(0, 1); |
| | | if (substring1.equals("w")) { |
| | | //把文件下载到本地 |
| | |
| | | ftp.completePendingCommand(); |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |