| | |
| | | |
| | | import java.io.*; |
| | | import java.net.SocketException; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import static org.springblade.common.constant.FtpConstant.*; |
| | | import static org.springblade.common.constant.FtpConstant.ftpPassword; |
| | |
| | | * @param s1 sql |
| | | */ |
| | | public static void sqlFileUpload(String s1){ |
| | | String json1 = JSON.toJSONString(s1); |
| | | String response1 = String.valueOf((new Date()).getTime()); |
| | | OutJson.createJsonFile(json1, "d:/", "w"+response1); |
| | | FileInputStream in1 = null; |
| | | try { |
| | | in1 = new FileInputStream(new File("D:\\" + "w"+response1+".json")); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, "anbao/", "/", "w"+response1+".json", in1); |
| | | // String json1 = JSON.toJSONString(s1); |
| | | // String response1 = String.valueOf((new Date()).getTime()); |
| | | // OutJson.createJsonFile(json1, localPath, "w"+response1); |
| | | // FileInputStream in1 = null; |
| | | // try { |
| | | // in1 = new FileInputStream(new File(localPath + "w"+response1+".json")); |
| | | // } catch (FileNotFoundException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // FtpUtil.uploadFile(ftpHost_dev, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", "w"+response1+".json", in1); |
| | | // MysqlCenlint.deletess("w"+response1+".json"); |
| | | } |
| | | |
| | | } |