@RequestMapping(value = {"/geoserver.action", "/geoserver.action/{endpoint}"}, method = {
        RequestMethod.GET, RequestMethod.POST})
    public ResponseEntity<?> interceptGeoServerRequest( HttpServletRequest request, @PathVariable(value="endpoint", required = false) Optional<String> endpoint ) {
        HttpHeaders responseHeaders = new HttpHeaders();
        HttpStatus responseStatus = HttpStatus.OK;
        byte[] responseBody = null;
        Response httpResponse = null;

        try {
            LOG.trace("Trying to intercept a GeoServer resource.");

            httpResponse = this.service.interceptGeoServerRequest(request, endpoint);

            responseStatus = httpResponse.getStatusCode();
            responseBody = httpResponse.getBody();
            responseHeaders = httpResponse.getHeaders();

            LOG.trace("Successfully intercepted a GeoServer resource.");

            return new ResponseEntity<byte[]>(responseBody,
                responseHeaders, responseStatus);

        } catch (Exception e) {
            LOG.error(ERROR_MESSAGE + e.getMessage());

            responseHeaders.setContentType(MediaType.APPLICATION_JSON);

            Map<String, Object> responseMsg = ResultSet.error(
                ERROR_MESSAGE + e.getMessage());

            return new ResponseEntity<Map<String, Object>>(responseMsg,
                responseHeaders, responseStatus);
        }

    }
@ RequestMapping ( value = { "/geoserver.action" , "/geoserver.action/{endpoint}" } , method = { RequestMethod . GET , RequestMethod . POST } ) public ResponseEntity < ? > interceptGeoServerRequest ( HttpServletRequest request , @ PathVariable ( value = "endpoint" , required = false ) Optional < String > endpoint ) { HttpHeaders responseHeaders = new HttpHeaders ( ) ; HttpStatus responseStatus = HttpStatus . OK ; byte [ ] responseBody = null ; Response httpResponse = null ; try { LOG . trace ( "Trying to intercept a GeoServer resource." ) ; httpResponse = this . service . interceptGeoServerRequest ( request , endpoint ) ; responseStatus = httpResponse . getStatusCode ( ) ; responseBody = httpResponse . getBody ( ) ; responseHeaders = httpResponse . getHeaders ( ) ; LOG . trace ( "Successfully intercepted a GeoServer resource." ) ; return new ResponseEntity < byte [ ] > ( responseBody , responseHeaders , responseStatus ) ; } catch ( Exception e ) { LOG . error ( ERROR_MESSAGE + e . getMessage ( ) ) ; responseHeaders . setContentType ( MediaType . APPLICATION_JSON ) ; Map < String , Object > responseMsg = ResultSet . error ( ERROR_MESSAGE + e . getMessage ( ) ) ; return new ResponseEntity < Map < String , Object > > ( responseMsg , responseHeaders , responseStatus ) ; } }
@param request