智慧保安后台管理项目备份
Administrator
2021-08-24 4120d33fd6fae0fe05b8af0c45ae6b9ccebe6723
ftp 账号名修改
2 files modified
12 ■■■■ changed files
src/main/java/org/springblade/common/constant/FtpConstant.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/FTP/monitor.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/constant/FtpConstant.java
@@ -1,5 +1,8 @@
package org.springblade.common.constant;
/**
 * @author zhongrj
 */
public interface FtpConstant {
    /**
@@ -22,7 +25,8 @@
    int ftpPort = 21;
    //ftp服务器用户名
    String ftpUserName = "yly";
    String ftpUserName = "ylcs";
//    String ftpUserName = "yly";
    //ftp服务器密码
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;
            }