| | |
| | | } 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, 2); |
| | | if (substring1.equals("ni")){ |
| | | // InputStream is = ftp.retrieveFileStream(new String(fileName.getBytes("GBK"), FTP.DEFAULT_CONTROL_ENCODING)); |
| | | // String substring1 = fileName.substring(0, 2); |
| | | if (fileName.contains("ni")){ |
| | | System.out.println("-------接收到内网回传的文件: " + fileName); |
| | | //把文件下载到本地 |
| | | FtpUtil.downloadFtpFile(ftpHost, ftpUserNameIn, ftpPasswordIn, ftpPort, ftpPath, localPath, fileName); |
| | |
| | | MysqlCenlint.deletess(fileName); |
| | | // ftp.dele(fileName); |
| | | FtpUtil.deleteFile(ftpHost, ftpPort, ftpUserNameIn, ftpPasswordIn, ftpPath, fileName); |
| | | is.close(); |
| | | // is.close(); |
| | | ftp.completePendingCommand(); |
| | | if (result.getCode()==200) { |
| | | //返回 |
| | |
| | | } 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, 2); |
| | | if (substring1.equals("nl")){ |
| | | if (fileName.contains("nl")){ |
| | | //转流 |
| | | // InputStream is = ftp.retrieveFileStream(new String(fileName.getBytes("GBK"), FTP.DEFAULT_CONTROL_ENCODING)); |
| | | //把文件下载到本地 |
| | | FtpUtil.downloadFtpFile(ftpHost, ftpUserNameIn, ftpPasswordIn, ftpPort, ftpPath, localPath, fileName); |
| | | // 解析数据 |
| | |
| | | //返回 |
| | | return result; |
| | | } |
| | | is.close(); |
| | | // is.close(); |
| | | ftp.completePendingCommand(); |
| | | } |
| | | } |
| | |
| | | } 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, 2); |
| | | if (substring1.equals("nt")){ |
| | | // InputStream is = ftp.retrieveFileStream(new String(fileName.getBytes("GBK"), FTP.DEFAULT_CONTROL_ENCODING)); |
| | | // String substring1 = fileName.substring(0, 2); |
| | | if (fileName.contains("nt")){ |
| | | //把文件下载到本地 |
| | | FtpUtil.downloadFtpFile(ftpHost, ftpUserNameIn, ftpPasswordIn, ftpPort, ftpPath, localPath, fileName); |
| | | // 解析数据 |
| | |
| | | //返回 |
| | | return result; |
| | | } |
| | | is.close(); |
| | | // is.close(); |
| | | ftp.completePendingCommand(); |
| | | } |
| | | } |
| | |
| | | else { |
| | | for (FTPFile file : files) { |
| | | String fileName = file.getName(); |
| | | InputStream is = ftp.retrieveFileStream(new String(fileName.getBytes("GBK"), FTP.DEFAULT_CONTROL_ENCODING)); |
| | | if (null == is) { |
| | | return false; |
| | | } else { |
| | | String substring1 = fileName.substring(0, 2); |
| | | if (substring1.equals("nq")) { |
| | | // InputStream is = ftp.retrieveFileStream(new String(fileName.getBytes("GBK"), FTP.DEFAULT_CONTROL_ENCODING)); |
| | | // if (null == is) { |
| | | // return false; |
| | | // } else { |
| | | // String substring1 = fileName.substring(0, 2); |
| | | if (fileName.contains("nq")) { |
| | | //把文件下载到本地 |
| | | FtpUtil.downloadFtpFile(ftpHost, ftpUserNameIn, ftpPasswordIn, ftpPort, ftpPath, localPath, fileName); |
| | | // |
| | |
| | | FtpUtil.deleteFile(ftpHost, ftpPort, ftpUserNameIn, ftpPasswordIn, ftpPath, fileName); |
| | | } |
| | | //关闭流 |
| | | is.close(); |
| | | // is.close(); |
| | | ftp.completePendingCommand(); |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | } 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, 2); |
| | | if (substring1.equals("ns")){ |
| | | // InputStream is = ftp.retrieveFileStream(new String(fileName.getBytes("GBK"), FTP.DEFAULT_CONTROL_ENCODING)); |
| | | // String substring1 = fileName.substring(0, 2); |
| | | if (fileName.contains("ns")){ |
| | | //把文件下载到本地 |
| | | FtpUtil.downloadFtpFile(ftpHost, ftpUserNameIn, ftpPasswordIn, ftpPort, ftpPath, localPath, fileName); |
| | | // 解析数据 |
| | |
| | | //返回 |
| | | return result; |
| | | } |
| | | is.close(); |
| | | // is.close(); |
| | | ftp.completePendingCommand(); |
| | | } |
| | | } |