Class SQLite3Parser

java.lang.Object
org.apache.tika.parser.AbstractParser
org.apache.tika.parser.sqlite3.SQLite3Parser
All Implemented Interfaces:
Serializable, org.apache.tika.config.Initializable, org.apache.tika.parser.Parser

public class SQLite3Parser extends org.apache.tika.parser.AbstractParser implements org.apache.tika.config.Initializable
This is the main class for parsing SQLite3 files. When parse(java.io.InputStream, org.xml.sax.ContentHandler, org.apache.tika.metadata.Metadata, org.apache.tika.parser.ParseContext) is called, this creates a new SQLite3DBParser.

Given potential conflicts of native libraries in web servers, users will need to add org.xerial's sqlite-jdbc jar to the class path for this parser to work. For development and testing, this jar is specified in tika-parsers' pom.xml, but it is currently set to "provided."

Note that this family of jdbc parsers is designed to treat each CLOB and each BLOB as an embedded document; i.e. it will recursively process documents that are stored in a sqlite db as "bytes".

If using a TikaInputStream, make sure to close it to delete the temp file that has to be created.

See Also:
  • Constructor Details

    • SQLite3Parser

      public SQLite3Parser()
      Checks to see if class is available for org.sqlite.JDBC.

      If not, this class will return an EMPTY_SET for getSupportedTypes()

  • Method Details

    • getSupportedTypes

      public Set<org.apache.tika.mime.MediaType> getSupportedTypes(org.apache.tika.parser.ParseContext context)
      Specified by:
      getSupportedTypes in interface org.apache.tika.parser.Parser
    • parse

      public void parse(InputStream stream, ContentHandler handler, org.apache.tika.metadata.Metadata metadata, org.apache.tika.parser.ParseContext context) throws IOException, SAXException, org.apache.tika.exception.TikaException
      Specified by:
      parse in interface org.apache.tika.parser.Parser
      Throws:
      IOException
      SAXException
      org.apache.tika.exception.TikaException
    • initialize

      public void initialize(Map<String,org.apache.tika.config.Param> params) throws org.apache.tika.exception.TikaConfigException
      No-op
      Specified by:
      initialize in interface org.apache.tika.config.Initializable
      Parameters:
      params - params to use for initialization
      Throws:
      org.apache.tika.exception.TikaConfigException
    • checkInitialization

      public void checkInitialization(org.apache.tika.config.InitializableProblemHandler problemHandler) throws org.apache.tika.exception.TikaConfigException
      Specified by:
      checkInitialization in interface org.apache.tika.config.Initializable
      Throws:
      org.apache.tika.exception.TikaConfigException