Interface EmbeddedDocumentExtractor

All Known Implementing Classes:
ParsingEmbeddedDocumentExtractor, UnpackExtractor

public interface EmbeddedDocumentExtractor
Implementations are typically bound as a single shared instance reused across concurrent parses (see ParsingEmbeddedDocumentExtractor.INSTANCE) -- do not cache per-parse state on this; read it from the ParseContext parameter on each call instead.
  • Method Details

    • shouldParseEmbedded

      boolean shouldParseEmbedded(Metadata metadata, ParseContext parseContext)
      Determines whether the given embedded document should be parsed.

      Note: Implementations may throw EmbeddedLimitReachedException (a RuntimeException) if a limit is exceeded and throwing is configured.

      Parameters:
      metadata - the metadata for the embedded document
      parseContext - the parse context of the enclosing parse
      Returns:
      true if the embedded document should be parsed
    • parseEmbedded

      void parseEmbedded(TikaInputStream stream, ContentHandler handler, Metadata metadata, ParseContext parseContext, boolean outputHtml) throws SAXException, IOException
      Processes the supplied embedded resource, calling the delegating parser with the appropriate details.
      Parameters:
      stream - The embedded resource
      handler - The handler to use
      metadata - The metadata for the embedded resource
      parseContext - The parse context
      outputHtml - Should we output HTML for this resource, or has the parser already done so?
      Throws:
      SAXException
      IOException