private File downloadFileFromResponse(HttpResponse response) throws IOException {
    Header contentDispositionHeader = response.getFirstHeader("Content-Disposition");
    String contentDisposition = contentDispositionHeader == null ? null : contentDispositionHeader.getValue();
    File file = prepareDownloadFile(contentDisposition);
    Files.copy(response.getEntity().getContent(), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
    return file;
  }
Deserialize response body to Java object according to the Content-Type.

@param <T> Type
@param response Response
@param valueType Return type
@return Deserialized object
@throws ApiException API exception
@throws IOException IO exception
plc4j/drivers/ctrlx/src/main/java/org/apache/plc4x/java/ctrlx/readwrite/rest/datalayer/ApiClient.java