From 0110242f6f2e9c4c2da1d8eb439eb5ece25fdcbc Mon Sep 17 00:00:00 2001 From: leif stawnyczy Date: Fri, 9 Aug 2024 17:17:55 -0400 Subject: [PATCH] spotless --- .../okhttp/client/OkHttpRestfulClient.java | 34 +++++++++++-------- .../rest/client/apache/BaseHttpClient.java | 3 +- .../method/HttpPatchClientInvocation.java | 3 +- .../fhir/jaxrs/client/JaxRsHttpClient.java | 3 +- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/hapi-fhir-client-okhttp/src/main/java/ca/uhn/fhir/okhttp/client/OkHttpRestfulClient.java b/hapi-fhir-client-okhttp/src/main/java/ca/uhn/fhir/okhttp/client/OkHttpRestfulClient.java index 20e1a99c13b..6b3447ccce0 100644 --- a/hapi-fhir-client-okhttp/src/main/java/ca/uhn/fhir/okhttp/client/OkHttpRestfulClient.java +++ b/hapi-fhir-client-okhttp/src/main/java/ca/uhn/fhir/okhttp/client/OkHttpRestfulClient.java @@ -28,7 +28,6 @@ import ca.uhn.fhir.rest.client.api.HttpClientUtil; import ca.uhn.fhir.rest.client.api.IHttpClient; import ca.uhn.fhir.rest.client.api.IHttpRequest; import ca.uhn.fhir.rest.client.impl.BaseHttpClientInvocation; -import ca.uhn.fhir.rest.client.impl.RestfulClientFactory; import ca.uhn.fhir.rest.client.method.MethodUtil; import ca.uhn.fhir.rest.param.HttpClientRequestParameters; import okhttp3.Call; @@ -88,11 +87,7 @@ public class OkHttpRestfulClient implements IHttpClient { } private void initBaseRequest( - FhirContext theContext, - EncodingEnum theEncoding, - RequestBody body, - RequestTypeEnum theRequestType - ) { + FhirContext theContext, EncodingEnum theEncoding, RequestBody body, RequestTypeEnum theRequestType) { RequestTypeEnum requestType = theRequestType != null ? theRequestType : myRequestType; String sanitisedUrl = withTrailingQuestionMarkRemoved(myUrl.toString()); myRequest = new OkHttpRestfulRequest(myClient, sanitisedUrl, requestType, body); @@ -123,7 +118,11 @@ public class OkHttpRestfulClient implements IHttpClient { @Override public IHttpRequest createBinaryRequest(FhirContext theContext, IBaseBinary theBinary) { - initBaseRequest(theContext, null, createPostBody(theBinary.getContent(), theBinary.getContentType()), RequestTypeEnum.POST); + initBaseRequest( + theContext, + null, + createPostBody(theBinary.getContent(), theBinary.getContentType()), + RequestTypeEnum.POST); return myRequest; } @@ -143,25 +142,29 @@ public class OkHttpRestfulClient implements IHttpClient { switch (theParameters.getRequestTypeEnum()) { case POST: case PUT: - if (theParameters.getFormParams() != null && !theParameters.getFormParams().isEmpty()) { + if (theParameters.getFormParams() != null + && !theParameters.getFormParams().isEmpty()) { requestBody = getFormBodyFromParams(theParameters.getFormParams()); } else if (theParameters.getByteContents() != null) { requestBody = createPostBody(theParameters.getByteContents(), theParameters.getContentType()); } else if (isNotBlank(theParameters.getContents())) { requestBody = createPostBody(theParameters.getContents(), theParameters.getContentType()); } else if (theParameters.getBaseBinary() != null) { - requestBody = createPostBody(theParameters.getBaseBinary().getContent(), theParameters.getContentType()); + requestBody = + createPostBody(theParameters.getBaseBinary().getContent(), theParameters.getContentType()); } else { - ourLog.debug("No body contents found for HTTP-{}", theParameters.getRequestTypeEnum().name()); + ourLog.debug( + "No body contents found for HTTP-{}", + theParameters.getRequestTypeEnum().name()); } break; } initBaseRequest( - theParameters.getFhirContext(), - theParameters.getEncodingEnum(), - requestBody, - theParameters.getRequestTypeEnum()); + theParameters.getFhirContext(), + theParameters.getEncodingEnum(), + requestBody, + theParameters.getRequestTypeEnum()); return myRequest; } @@ -171,7 +174,8 @@ public class OkHttpRestfulClient implements IHttpClient { } @Override - public void setNewUrl(StringBuilder theUrl, String theIfNoneExistString, Map> theIfNoneExistParams) { + public void setNewUrl( + StringBuilder theUrl, String theIfNoneExistString, Map> theIfNoneExistParams) { myUrl = theUrl; myIfNoneExistString = theIfNoneExistString; myIfNoneExistParams = theIfNoneExistParams; diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/apache/BaseHttpClient.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/apache/BaseHttpClient.java index dfaf13aeed0..41e3a36827d 100644 --- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/apache/BaseHttpClient.java +++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/apache/BaseHttpClient.java @@ -60,7 +60,8 @@ public abstract class BaseHttpClient implements IHttpClient { } @Override - public void setNewUrl(StringBuilder theUrl, String theIfNoneExistString, Map> theIfNoneExistParams) { + public void setNewUrl( + StringBuilder theUrl, String theIfNoneExistString, Map> theIfNoneExistParams) { myUrl = theUrl; myIfNoneExistString = theIfNoneExistString; myIfNoneExistParams = theIfNoneExistParams; diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/HttpPatchClientInvocation.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/HttpPatchClientInvocation.java index c84ddb50ece..3f0a5a266f0 100644 --- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/HttpPatchClientInvocation.java +++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/HttpPatchClientInvocation.java @@ -118,7 +118,8 @@ public class HttpPatchClientInvocation extends BaseHttpClientInvocation { client.setNewUrl(new StringBuilder(theParameters.getUrl()), null, null); } - HttpClientRequestParameters params = new HttpClientRequestParameters(theParameters.getUrl(), RequestTypeEnum.PATCH); + HttpClientRequestParameters params = + new HttpClientRequestParameters(theParameters.getUrl(), RequestTypeEnum.PATCH); params.setContents(myContents); params.setContentType(myContentType); params.setFhirContext(getContext()); diff --git a/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/client/JaxRsHttpClient.java b/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/client/JaxRsHttpClient.java index 5684f34b1f7..f0e7d0549a5 100644 --- a/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/client/JaxRsHttpClient.java +++ b/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/client/JaxRsHttpClient.java @@ -166,7 +166,8 @@ public class JaxRsHttpClient implements IHttpClient { } @Override - public void setNewUrl(StringBuilder theUrl, String theIfNoneExistString, Map> theIfNoneExistParams) { + public void setNewUrl( + StringBuilder theUrl, String theIfNoneExistString, Map> theIfNoneExistParams) { myUrl = theUrl; myIfNoneExistString = theIfNoneExistString; myIfNoneExistParams = theIfNoneExistParams;