| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | |
| | | @Component |
| | | public class monitor { |
| | |
| | | else { |
| | | for (FTPFile file : files){ |
| | | String fileName = file.getName(); |
| | | InputStream is = ftp.retrieveFileStream(new String(fileName.getBytes("GBK"), FTP.DEFAULT_CONTROL_ENCODING)); |
| | | String substring1 = fileName.substring(0, 1); |
| | | if (substring1.equals("w")) { |
| | | //把文件下载到本地 |
| | |
| | | MysqlCenlint.deletes(fileName); |
| | | MysqlCenlint.deletess(fileName); |
| | | FtpUtil.deleteFile(ftpHost, ftpPort, ftpUserName, ftpPassword, "anbao/", fileName); |
| | | //is.close(); |
| | | is.close(); |
| | | ftp.completePendingCommand(); |
| | | } |
| | | } |