/** * @TODO: this method is only called from one place and should be removed anyway */ public static EncodingEnum determineRequestEncoding(RequestDetails theReq) { EncodingEnum retVal = determineRequestEncodingNoDefault(theReq); if (retVal != null) { return retVal; } return EncodingEnum.XML; }
@Override public boolean incomingRequestPostProcessed(RequestDetails theRequestDetails, HttpServletRequest theRequest, HttpServletResponse theResponse) throws AuthenticationException { EncodingEnum encoding = RestfulServerUtils.determineRequestEncodingNoDefault(theRequestDetails); if (encoding == null) { ourLog.trace("Incoming request does not appear to be FHIR, not going to validate"); return true; } Charset charset = ResourceParameter.determineRequestCharset(theRequestDetails); String requestText = new String(theRequestDetails.loadRequestContents(), charset); if (isBlank(requestText)) { ourLog.trace("Incoming request does not have a body"); return true; } ValidationResult validationResult = validate(requestText, theRequestDetails); // The JPA server will use this theRequestDetails.getUserData().put(REQUEST_VALIDATION_RESULT, validationResult); return true; }
@Override public Object translateQueryParametersIntoServerArgument(RequestDetails theRequest, BaseMethodBinding<?> theMethodBinding) throws InternalErrorException, InvalidRequestException { switch (myMode) { case BODY: try { return IOUtils.toString(createRequestReader(theRequest)); } catch (IOException e) { // Shouldn't happen since we're reading from a byte array throw new InternalErrorException("Failed to load request", e); } case BODY_BYTE_ARRAY: return theRequest.loadRequestContents(); case ENCODING: return RestfulServerUtils.determineRequestEncodingNoDefault(theRequest); case RESOURCE: default: Class<? extends IBaseResource> resourceTypeToParse = myResourceType; if (myMethodIsOperation) { // Operations typically have a Parameters resource as the body resourceTypeToParse = null; } return parseResourceFromRequest(theRequest, theMethodBinding, resourceTypeToParse); } // } }
/** * @TODO: this method is only called from one place and should be removed anyway */ public static EncodingEnum determineRequestEncoding(RequestDetails theReq) { EncodingEnum retVal = determineRequestEncodingNoDefault(theReq); if (retVal != null) { return retVal; } return EncodingEnum.XML; }
EncodingEnum encoding = RestfulServerUtils.determineRequestEncodingNoDefault(theRequest); if (encoding == null) { String ctValue = theRequest.getHeader(Constants.HEADER_CONTENT_TYPE);
@Override public boolean incomingRequestPostProcessed(RequestDetails theRequestDetails, HttpServletRequest theRequest, HttpServletResponse theResponse) throws AuthenticationException { EncodingEnum encoding = RestfulServerUtils.determineRequestEncodingNoDefault(theRequestDetails); if (encoding == null) { ourLog.trace("Incoming request does not appear to be FHIR, not going to validate"); return true; } Charset charset = ResourceParameter.determineRequestCharset(theRequestDetails); String requestText = new String(theRequestDetails.loadRequestContents(), charset); if (isBlank(requestText)) { ourLog.trace("Incoming request does not have a body"); return true; } ValidationResult validationResult = validate(requestText, theRequestDetails); // The JPA server will use this theRequestDetails.getUserData().put(REQUEST_VALIDATION_RESULT, validationResult); return true; }
@Override public Object translateQueryParametersIntoServerArgument(RequestDetails theRequest, BaseMethodBinding<?> theMethodBinding) throws InternalErrorException, InvalidRequestException { switch (myMode) { case BODY: try { return IOUtils.toString(createRequestReader(theRequest)); } catch (IOException e) { // Shouldn't happen since we're reading from a byte array throw new InternalErrorException("Failed to load request", e); } case BODY_BYTE_ARRAY: return theRequest.loadRequestContents(); case ENCODING: return RestfulServerUtils.determineRequestEncodingNoDefault(theRequest); case RESOURCE: default: Class<? extends IBaseResource> resourceTypeToParse = myResourceType; if (myMethodIsOperation) { // Operations typically have a Parameters resource as the body resourceTypeToParse = null; } return parseResourceFromRequest(theRequest, theMethodBinding, resourceTypeToParse); } // } }
EncodingEnum encoding = RestfulServerUtils.determineRequestEncodingNoDefault(theRequest); if (encoding == null) { String ctValue = theRequest.getHeader(Constants.HEADER_CONTENT_TYPE);