| | |
| | | /** |
| | | * 获取元数据信息 |
| | | */ |
| | | public byte[] getLayerJson(String serviceName) { |
| | | public byte[] getson(String serviceName, String json) { |
| | | try { |
| | | String filePath = config.getOutPath() + File.separator + serviceName + File.separator + "layer.json"; |
| | | String filePath = config.getOutPath() + File.separator + serviceName + File.separator + json; |
| | | |
| | | File dat = new File(filePath); |
| | | if (!dat.exists()) { |
| | |
| | | |
| | | return bytes; |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | return null; |
| | | } |
| | | } |
| | |
| | | layer.setWaters(new Water(data)); |
| | | |
| | | return layer; |
| | | } |
| | | |
| | | /** |
| | | * 获取降水曲线文件曲线图 |
| | | */ |
| | | public byte[] getRainfall(String serviceName) { |
| | | try { |
| | | String filePath = config.getOutPath() + File.separator + serviceName + File.separator + "rainfall.json"; |
| | | |
| | | File rainfall = new File(filePath); |
| | | if (!rainfall.exists()) { |
| | | return null; |
| | | } |
| | | |
| | | byte[] bytes = new byte[(int) rainfall.length()]; |
| | | |
| | | FileInputStream fs = new FileInputStream(filePath); |
| | | fs.read(bytes); |
| | | fs.close(); |
| | | |
| | | return bytes; |
| | | } catch (Exception ex) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |