private void processResponse(WarcResponse warcResponse, XHTMLContentHandler xhtml,
                                 ParseContext context,
                                 EmbeddedDocumentExtractor embeddedDocumentExtractor)
            throws IOException, SAXException, TikaException {
        Optional<WarcPayload> optionalPayload = warcResponse.payload();
        if (!optionalPayload.isPresent()) {
            //TODO handle missing payload?  Report or ignore?
            return;
        }
        Metadata metadata = new Metadata();
        setNotNull(WARC.WARC_RECORD_CONTENT_TYPE, warcResponse.contentType(), metadata);
        setNotNull(WARC.WARC_PAYLOAD_CONTENT_TYPE, warcResponse.payloadType(), metadata);
        processWarcMetadata(warcResponse, metadata);
        processHttpResponseMetadata(warcResponse.http(), metadata);
        if (warcResponse.warcinfoID().isPresent()) {
            String id = warcResponse.id().toString();
            metadata.set(TikaCoreProperties.RESOURCE_NAME_KEY, id);
        }
        WarcPayload payload = optionalPayload.get();
        metadata.set(WARC.WARC_RECORD_CONTENT_TYPE, payload.type().toString());
        metadata.set(Metadata.CONTENT_LENGTH, Long.toString(payload.body().size()));

        if (embeddedDocumentExtractor.shouldParseEmbedded(metadata)) {
            //TODO check Content-Encoding on the warcResponse.http.headers and wrap the stream.
            //May need to sniff first few bytes to confirm accuracy, e.g. gzip compression ?
            try (TikaInputStream tis = TikaInputStream.get(payload.body().stream())) {
                embeddedDocumentExtractor.parseEmbedded(tis, xhtml, metadata, true);
            }
        }

    }
This uses jwarc to parse warc files and arc files
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-webarchive-module/src/main/java/org/apache/tika/parser/warc/WARCParser.java