diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/BaseServerResponseException.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/BaseServerResponseException.java index f5da60074c0..04d8879301c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/BaseServerResponseException.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/BaseServerResponseException.java @@ -1,11 +1,11 @@ package ca.uhn.fhir.rest.server.exceptions; -import java.lang.reflect.InvocationTargetException; -import java.util.*; - import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; +import java.lang.reflect.InvocationTargetException; +import java.util.*; + /* * #%L @@ -16,9 +16,9 @@ import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -32,7 +32,7 @@ import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; * subclasses of this exception type. *
* HAPI provides a number of subclasses of BaseServerResponseException, and each one corresponds to a specific
- * HTTP status code. For example, if a IResourceProvider method throws
+ * HTTP status code. For example, if a IResourceProvider method throws
* {@link ResourceNotFoundException}, this is a signal to the server that an HTTP 404
should
* be returned to the client.
*
this
for easy method chaining
* @since 2.0
@@ -193,7 +193,7 @@ public abstract class BaseServerResponseException extends RuntimeException {
Validate.notBlank(theName, "theName must not be null or empty");
Validate.notBlank(theValue, "theValue must not be null or empty");
if (getResponseHeaders().containsKey(theName) == false) {
- getResponseHeaders().put(theName, new ArrayListnull
otherwise.
*
@@ -220,17 +231,24 @@ public abstract class BaseServerResponseException extends RuntimeException {
return myResponseBody;
}
+ /**
+ * This method is currently only called internally by HAPI, it should not be called by user code.
+ */
+ public void setResponseBody(String theResponseBody) {
+ myResponseBody = theResponseBody;
+ }
+
/**
* Returns a map containing any headers which should be added to the outgoing
* response. This methos creates the map if none exists, so it will never
* return null
- *
+ *
* @since 2.0 (note that this method existed in previous versions of HAPI but the method
- * signature has been changed from Map<String, String[]>
to Map<String, List<String>>
+ * signature has been changed from Map<String, String[]>
to Map<String, List<String>>
*/
public Mapfalse
*
+ * Note that this setting is ignored by {@link ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor} + * when streaming HTML, although even when that interceptor it used this setting will + * still be honoured when streaming raw FHIR. + *
* * @return Returns the default pretty print setting */ @@ -1219,6 +1224,11 @@ public class RestfulServer extends HttpServlet implements IRestfulServerfalse
*
+ * + * Note that this setting is ignored by {@link ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor} + * when streaming HTML, although even when that interceptor it used this setting will + * still be honoured when streaming raw FHIR. + *
* * @param theDefaultPrettyPrint The default pretty print setting */