Class ExplicitCharsetToStringResponseHandler

java.lang.Object
org.apache.hc.client5.http.impl.classic.AbstractHttpClientResponseHandler<String>
org.owasp.dependencycheck.utils.ExplicitCharsetToStringResponseHandler
All Implemented Interfaces:
org.apache.hc.core5.http.io.HttpClientResponseHandler<String>

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

    • ExplicitCharsetToStringResponseHandler

      public ExplicitCharsetToStringResponseHandler(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 Details

    • handleEntity

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