| | |
| | | //ftp.changeWorkingDirectory(new String(dir.getBytes("GBK"), FTP.DEFAULT_CONTROL_ENCODING)); |
| | | |
| | | // 检验文件是否存在 |
| | | ftp.changeWorkingDirectory(ftpPath); |
| | | FTPFile[] files = ftp.listFiles(); |
| | | if (files.length == 0) { |
| | | return false; |
| | | } else { |
| | | for (FTPFile file : files) { |
| | | System.out.println("文件:"+file); |
| | | String fileName = file.getName(); |
| | | InputStream is = ftp.retrieveFileStream(new String(fileName.getBytes("GBK"), FTP.DEFAULT_CONTROL_ENCODING)); |
| | | if (null == is) { |
| | |
| | | } |
| | | else { |
| | | //把文件下载到本地 |
| | | FtpUtil.downloadFtpFile(ftpHost_dev, ftpUserName, ftpPassword, ftpPort, ftpPath, localPath, fileName); |
| | | FtpUtil.downloadFtpFile(ftpHost_dev, ftpUserName, ftpPassword, ftpPort, ftpPath, MinioPath, fileName); |
| | | //MysqlCenlint.deletess(fileName); |
| | | FtpUtil.deleteFile(ftpHost_dev, ftpPort, ftpUserName, ftpPassword, "anbao/", fileName); |
| | | is.close(); |