求大佬解答 写的要不然就是端口无法连接 要不然就是文件下载异常
//@Scheduled(cron = "0 0 10 * * ?") public static boolean downFileByPath( ) { FTPClient ftp = new FTPClient(); try { Date date=new Date(); String separateDate = new SimpleDateFormat("yyyyMMdd").format(DateUtils.addDays(new Date(), - 1)); String url = ""; String username = ""; String password = ""; String remotePath = ""; String localPath = "D:/downFile"; String fileName = "_"+separateDate+"_9.xls"; int reply; ftp.connect(url,21); //如果采用默认端口,可以使用ftp.connect(url)的方式直接连接FTP服务器 ftp.login(username, password);//登录 reply = ftp.getReplyCode(); if (!FTPReply.isPositiveCompletion(reply)) { ftp.disconnect(); return false; } //转移到FTP服务器目录 boolean result