| | |
| | | private final static String UNKNOWN = "unknown"; |
| | | |
| | | /** |
| | | * 格式化当前系统日期 4 |
| | | * 格式化日期 |
| | | */ |
| | | public static final SimpleDateFormat YMDHMS = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | public final static SimpleDateFormat YMDHMS = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | |
| | | /** |
| | | * 字符串,是否为空null和空格 |
| | |
| | | |
| | | /** |
| | | * 获取主机IP |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getHostIp() { |
| | | try { |
| | |
| | | res.setStatus(HttpStatus.NOT_FOUND.value()); |
| | | return; |
| | | } |
| | | |
| | | |
| | | String fileName = URLEncoder.encode(filePath, "UTF-8").replace("+", "%20"); |
| | | res.setHeader("Content-Disposition", "attachment; filename*=UTF-8''" + fileName); |
| | |
| | | * 获取水面高度图 |
| | | */ |
| | | public String getWaterMap(String serviceName, Integer width, Integer height, Long timestamp) { |
| | | return dataPath + File.separator + serviceName + File.separator + "waters" + File.separator + timestamp+ File.separator + width + "_" + height + ".png"; |
| | | return dataPath + File.separator + serviceName + File.separator + "waters" + File.separator + timestamp + File.separator + width + "_" + height + ".png"; |
| | | } |
| | | |
| | | /** |
| | | * 获取水流向流速图 |
| | | */ |
| | | public String getFlowMap(String serviceName, Integer width, Integer height, Long timestamp) { |
| | | return dataPath + File.separator + serviceName + File.separator + "flow" + File.separator + timestamp+ File.separator + width + "_" + height + ".png"; |
| | | return dataPath + File.separator + serviceName + File.separator + "flow" + File.separator + timestamp + File.separator + width + "_" + height + ".png"; |
| | | } |
| | | |
| | | /** |
| | | * 获取图层 |
| | | */ |
| | | public Layer getLayer(String serviceName) { |
| | | Layer layer = new Layer(); |
| | | layer.setVersion(ver); |