|  |  | 
 |  |  |         String path = applicationHome.getSource().getParentFile().toString() + "/static/tsv"; | 
 |  |  |  | 
 |  |  |         //File file = File.createTempFile("test",".tsv"); | 
 |  |  |         if (!new File(path).exists()){ | 
 |  |  |         /*if (!new File(path).exists()){ | 
 |  |  |             new File(path).mkdir(); | 
 |  |  |         } | 
 |  |  |         }*/ | 
 |  |  |         File file = null; | 
 |  |  |         File dir = new File(path); | 
 |  |  |         file = File.createTempFile("honeycombDiagram",".tsv",dir); | 
 |  |  | 
 |  |  |         OutputStreamWriter ow = new OutputStreamWriter(new FileOutputStream(file),"UTF-8"); | 
 |  |  |  | 
 |  |  |         //tsv文件是空格分隔,除第一个外,每次写入一个单元格数据后需要输入空格 | 
 |  |  |         ow.write("lon"); | 
 |  |  |         ow.write("lng"); | 
 |  |  |         ow.write("  "); | 
 |  |  |         ow.write("lat"); | 
 |  |  |         ow.write("  "); | 
 |  |  |         ow.write("value"); | 
 |  |  |         ow.write("count"); | 
 |  |  |         //写完文件头换行 | 
 |  |  |         ow.write("\r\n"); | 
 |  |  |         //写内容 | 
 |  |  | 
 |  |  |         ow.flush(); | 
 |  |  |         ow.close(); | 
 |  |  |  | 
 |  |  |         /*String localAddr = httpServletRequest.getLocalAddr(); | 
 |  |  |         int serverPort = httpServletRequest.getServerPort();*/ | 
 |  |  |  | 
 |  |  |         Map<String,Object> res = new HashMap<>(); | 
 |  |  |         res.put("path",file.getPath()); | 
 |  |  |         res.put("path","http://47.99.64.149:8081"+"/static/tsv/"+file.getName()); | 
 |  |  |  | 
 |  |  |         return ResultMessage.ok(res); | 
 |  |  |     } |