| | |
| | | FTPFile[] files = ftp.listFiles(); |
| | | if (files.length==0){ |
| | | return false; |
| | | } |
| | | else { |
| | | } else { |
| | | for (FTPFile file : files){ |
| | | String fileName = file.getName(); |
| | | InputStream is = ftp.retrieveFileStream(new String(fileName.getBytes("GBK"), FTP.DEFAULT_CONTROL_ENCODING)); |
| | |
| | | is.close(); |
| | | ftp.completePendingCommand(); |
| | | } |
| | | else { |
| | | //把文件下载到本地 |
| | | FtpUtil.downloadFtpFile(ftpHost_dev, ftpUserName, ftpPassword, ftpPort, ftpPath, localPath, fileName); |
| | | //MysqlCenlint.deletess(fileName); |
| | | FtpUtil.deleteFile(ftpHost_dev, ftpPort, ftpUserName, ftpPassword, "anbao/", fileName); |
| | | is.close(); |
| | | ftp.completePendingCommand(); |
| | | } |
| | | } |
| | | } |
| | | return true; |