Class ExplicitEncodingToStringResponseHandler

  • All Implemented Interfaces:
    org.apache.hc.core5.http.io.HttpClientResponseHandler<java.lang.String>

    public class ExplicitEncodingToStringResponseHandler
    extends org.apache.hc.client5.http.impl.classic.AbstractHttpClientResponseHandler<java.lang.String>
    A responseHandler that uses an explicit client-defined characterset to interpret the response payload as a string.
    Author:
    Hans Aikema
    • Constructor Summary

      Constructors 
      Constructor Description
      ExplicitEncodingToStringResponseHandler​(java.nio.charset.Charset charset)
      Constructs a repsonse handler to transfor the binary contents received using the given Charset.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String handleEntity​(org.apache.hc.core5.http.HttpEntity entity)  
      • Methods inherited from class org.apache.hc.client5.http.impl.classic.AbstractHttpClientResponseHandler

        handleResponse
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExplicitEncodingToStringResponseHandler

        public ExplicitEncodingToStringResponseHandler​(java.nio.charset.Charset charset)
        Constructs a repsonse handler to transfor the binary contents received using the given Charset.
        Parameters:
        charset - The Charset to be used to transform a downloaded file into a String.
    • Method Detail

      • handleEntity

        public java.lang.String handleEntity​(org.apache.hc.core5.http.HttpEntity entity)
                                      throws java.io.IOException
        Specified by:
        handleEntity in class org.apache.hc.client5.http.impl.classic.AbstractHttpClientResponseHandler<java.lang.String>
        Throws:
        java.io.IOException