| | |
| | | } |
| | | |
| | | private void copeGeoService(HttpResponse proxyResponse, HttpServletRequest request, HttpServletResponse response, ResEntity res) throws IOException { |
| | | if (StaticData.GET_CAPABILITIES.equals(res.getBak())) { |
| | | // |
| | | if (!StaticData.GET_CAPABILITIES.equals(res.getBak())) { |
| | | proxyResponse.getEntity().writeTo(response.getOutputStream()); |
| | | return; |
| | | } |
| | | |
| | | proxyResponse.getEntity().writeTo(response.getOutputStream()); |
| | | String str = EntityUtils.toString(proxyResponse.getEntity(), "UTF-8"); |
| | | int index = str.indexOf(StaticData.QUERYABLE); |
| | | while (index > -1) { |
| | | int start = str.indexOf("<Name>", index) + StaticData.I6; |
| | | int end = str.indexOf("</Layer>", index) + StaticData.I8; |
| | | |
| | | String name = ":" + str.substring(start, str.indexOf("</Name>", start)); |
| | | if (!res.getTab().contains(name)) { |
| | | str = str.substring(0, index) + str.substring(end); |
| | | index = str.indexOf(StaticData.QUERYABLE, index); |
| | | } else { |
| | | index = str.indexOf(StaticData.QUERYABLE, end); |
| | | } |
| | | } |
| | | |
| | | byte[] bytes = str.getBytes(StandardCharsets.UTF_8); |
| | | response.setContentLength(bytes.length); |
| | | response.getOutputStream().write(bytes); |
| | | } |
| | | |
| | | private void copeSjService(HttpResponse proxyResponse, HttpServletRequest request, HttpServletResponse response, ResEntity res) throws IOException { |