Class TikaAutoDetectParser

java.lang.Object
fr.paris.lutece.plugins.parser.service.TikaAutoDetectParser
All Implemented Interfaces:
fr.paris.lutece.portal.service.parser.Parser

@ApplicationScoped @Named("parser.tikaParser") public class TikaAutoDetectParser extends Object implements fr.paris.lutece.portal.service.parser.Parser
Universal parser using Tika's AutoDetectParser. This parser automatically detects the document format and applies the appropriate parsing strategy. Supports PDF, MS Office (legacy and OOXML), OpenDocument, HTML, archives, and many other formats. This implementation simplifies the architecture by replacing multiple specialized parsers with a single, intelligent parser that handles all supported formats.
  • Constructor Details

    • TikaAutoDetectParser

      public TikaAutoDetectParser()
      Constructor - initializes the AutoDetectParser
  • Method Details

    • parseToString

      public String parseToString(InputStream is) throws fr.paris.lutece.portal.service.parser.ParserException
      Parse the input stream content using Tika's AutoDetectParser. The parser automatically detects the document format based on: - Magic bytes (file signature) - File extension - MIME type
      Specified by:
      parseToString in interface fr.paris.lutece.portal.service.parser.Parser
      Throws:
      fr.paris.lutece.portal.service.parser.ParserException
    • parse

      public Reader parse(InputStream is) throws fr.paris.lutece.portal.service.parser.ParserException
      Specified by:
      parse in interface fr.paris.lutece.portal.service.parser.Parser
      Throws:
      fr.paris.lutece.portal.service.parser.ParserException