| | |
| | | // 设置编码格式 |
| | | ftp.setControlEncoding("GBK"); |
| | | System.out.println("ftpPathIn = " + ftpPathIn); |
| | | System.out.println("ftpPathInURLEncoder = " + URLEncoder.encode(ftpPathIn,"UTF-8")); |
| | | // 检验文件是否存在 |
| | | boolean ftpFile = ftp.changeWorkingDirectory(URLEncoder.encode(ftpPathIn,"UTF-8")); |
| | | boolean ftpFile = ftp.changeWorkingDirectory(ftpPathIn); |
| | | System.out.println("检验文件是否存在 = " + ftpFile); |
| | | FTPFile[] files = ftp.listFiles(); |
| | | System.out.println("files = " + files); |
| | |
| | | if (substring1.equals("n")){ |
| | | System.out.println("-------接收到内网回传的文件: " + substring1); |
| | | //把文件下载到本地 |
| | | FtpUtil.downloadFtpFile(ftpHost, ftpUserNameIn, ftpPasswordIn, ftpPort, URLEncoder.encode(ftpPathIn,"UTF-8"), localPath, fileName); |
| | | FtpUtil.downloadFtpFile(ftpHost, ftpUserNameIn, ftpPasswordIn, ftpPort, ftpPathIn, localPath, fileName); |
| | | // 解析数据 |
| | | String s = OutJson.TestJson(fileName); |
| | | //数据处理 |
| | | Result result = DataHandler.handler(s,uuid); |
| | | //删除本地文件 |
| | | MysqlCenlint.deletess(fileName); |
| | | FtpUtil.deleteFile(ftpHost, ftpPort, ftpUserNameIn, ftpPasswordIn, URLEncoder.encode(ftpPathIn,"UTF-8"), fileName); |
| | | FtpUtil.deleteFile(ftpHost, ftpPort, ftpUserNameIn, ftpPasswordIn, ftpPathIn, fileName); |
| | | is.close(); |
| | | ftp.completePendingCommand(); |
| | | if (result.getCode()==200) { |