智慧保安后台管理项目备份
Administrator
2021-08-24 4120d33fd6fae0fe05b8af0c45ae6b9ccebe6723
src/main/java/org/springblade/modules/FTP/monitor.java
@@ -19,7 +19,7 @@
   //private static String fileName = "nsql.json";
   //@Scheduled(cron = "*/30 * * * * ?")
   @Scheduled(cron = "*/30 * * * * ?")
   public static boolean isFTPFileExist() {
      FTPClient ftp = new FTPClient();
@@ -75,6 +75,9 @@
            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")) {
                  //把文件下载到本地
@@ -109,6 +112,7 @@
                  ftp.completePendingCommand();
               }
            }
            }
            return true;
         }