Class EpssResponseHandler

java.lang.Object
org.apache.hc.client5.http.impl.classic.AbstractHttpClientResponseHandler<List<EpssItem>>
io.github.jeremylong.openvulnerability.client.epss.EpssResponseHandler
All Implemented Interfaces:
org.apache.hc.core5.http.io.HttpClientResponseHandler<List<EpssItem>>

public class EpssResponseHandler extends org.apache.hc.client5.http.impl.classic.AbstractHttpClientResponseHandler<List<EpssItem>>
HTTP response handler for parsing EPSS CSV data.
  • Constructor Details

    • EpssResponseHandler

      public EpssResponseHandler()
      Constructs a new EpssResponseHandler.
  • Method Details

    • handleResponse

      public List<EpssItem> handleResponse(org.apache.hc.core5.http.ClassicHttpResponse response) throws IOException
      Handles the HTTP response and extracts EPSS items.
      Specified by:
      handleResponse in interface org.apache.hc.core5.http.io.HttpClientResponseHandler<List<EpssItem>>
      Overrides:
      handleResponse in class org.apache.hc.client5.http.impl.classic.AbstractHttpClientResponseHandler<List<EpssItem>>
      Parameters:
      response - the HTTP response
      Returns:
      a list of EPSS items
      Throws:
      IOException - if an I/O error occurs
    • handleEntity

      public List<EpssItem> handleEntity(org.apache.hc.core5.http.HttpEntity entity) throws IOException
      Handles the HTTP entity by parsing the GZIP-compressed CSV data.
      Specified by:
      handleEntity in class org.apache.hc.client5.http.impl.classic.AbstractHttpClientResponseHandler<List<EpssItem>>
      Parameters:
      entity - the HTTP entity
      Returns:
      a list of EPSS items
      Throws:
      IOException - if an I/O error occurs or the data cannot be parsed