钟日健
2022-05-18 ed41701a2954172d20b85da0ae01436375210840
src/main/java/org/springblade/modules/FTP/Monitor.java
@@ -18,7 +18,7 @@
@Component
public class Monitor {
   @Scheduled(cron = "*/5 * * * * ?")
//   @Scheduled(cron = "*/5 * * * * ?")
   public static boolean isFTPFileExist() {
      FTPClient ftp = new FTPClient();
@@ -52,14 +52,12 @@
         FTPFile[] files = ftp.listFiles();
         if (files.length == 0) {
            ftp.disconnect();
            return false;
         } else {
            for (FTPFile file : files) {
               fileName = file.getName();
               InputStream is = ftp.retrieveFileStream(new String(fileName.getBytes("GBK"), FTP.DEFAULT_CONTROL_ENCODING));
               if (null == is) {
                  ftp.disconnect();
                  return false;
               } else {
                  String substring1 = fileName.substring(0, 1);
                  //把文件下载到本地
@@ -146,7 +144,6 @@
                  ftp.completePendingCommand();
               }
            }
            ftp.disconnect();
            return true;
         }
      } catch (Exception e) {