Class LoggingHttpClientResponseHandler<T>

java.lang.Object
org.apache.hc.client5.http.impl.classic.AbstractHttpClientResponseHandler<T>
com.logicaldoc.util.http.LoggingHttpClientResponseHandler<T>
All Implemented Interfaces:
org.apache.hc.core5.http.io.HttpClientResponseHandler<T>
Direct Known Subclasses:
FileHttpClientResponseHandler, StreamHttpClientResponseHandler, StringHttpClientResponseHandler

public abstract class LoggingHttpClientResponseHandler<T> extends org.apache.hc.client5.http.impl.classic.AbstractHttpClientResponseHandler<T>
An extension of the starndard HttpClientReponseHandler that also logs the content of the response in case of error
Since:
8.9.3
Author:
Marco Meschieri - LogicalDOC
  • Constructor Details

    • LoggingHttpClientResponseHandler

      public LoggingHttpClientResponseHandler()
  • Method Details

    • handleResponse

      public T handleResponse(org.apache.hc.core5.http.ClassicHttpResponse response) throws IOException
      Specified by:
      handleResponse in interface org.apache.hc.core5.http.io.HttpClientResponseHandler<T>
      Overrides:
      handleResponse in class org.apache.hc.client5.http.impl.classic.AbstractHttpClientResponseHandler<T>
      Throws:
      IOException
    • getResponseBody

      public static String getResponseBody(org.apache.hc.core5.http.ClassicHttpResponse response) throws IOException
      Throws:
      IOException
    • getResponseBody

      public static String getResponseBody(org.apache.hc.core5.http.ClassicHttpResponse response, Integer maxLength) throws IOException
      Throws:
      IOException