Package org.apache.tika.parser.sqlite3
Class SQLite3DBParser
java.lang.Object
org.apache.tika.parser.jdbc.AbstractDBParser
org.apache.tika.parser.sqlite3.SQLite3DBParser
- All Implemented Interfaces:
Serializable,Parser
This is the implementation of the db parser for SQLite.
This parser is internal only; it should not be registered in the services
file or configured in the TikaConfig xml file.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Override this for any special handling of closing the connection.protected voidextractMetadata(Connection connection, Metadata metadata) This is called before parsing the tables to extract metadata from the db, if any.protected ConnectiongetConnection(InputStream stream, Metadata metadata, ParseContext context) Override this for special configuration of the connection, such as limiting the number of rows to be held in memory.protected StringgetConnectionString(InputStream is, Metadata metadata, ParseContext context) Implement for db specific connection information, e.g.protected StringJDBC class name, e.g. org.sqlite.JDBCgetSupportedTypes(ParseContext context) Returns the set of media types supported by this parser when used with the given parse context.getTableNames(Connection connection, Metadata metadata, ParseContext context) Returns the names of the tables to processprotected JDBCTableReadergetTableReader(Connection connection, String tableName, EmbeddedDocumentUtil embeddedDocumentUtil) Given a connection and a table name, return the JDBCTableReader for this db.getTableReader(Connection connection, String tableName, ParseContext context) Given a connection and a table name, return the JDBCTableReader for this db.Methods inherited from class org.apache.tika.parser.jdbc.AbstractDBParser
parse
-
Field Details
-
SQLITE_CLASS_NAME
- See Also:
-
METADATA_KEYS
-
-
Constructor Details
-
SQLite3DBParser
public SQLite3DBParser()
-
-
Method Details
-
getSupportedTypes
Description copied from interface:ParserReturns the set of media types supported by this parser when used with the given parse context.- Specified by:
getSupportedTypesin interfaceParser- Overrides:
getSupportedTypesin classAbstractDBParser- Parameters:
context- context- Returns:
- null (always)
-
getConnection
protected Connection getConnection(InputStream stream, Metadata metadata, ParseContext context) throws IOException Description copied from class:AbstractDBParserOverride this for special configuration of the connection, such as limiting the number of rows to be held in memory.- Overrides:
getConnectionin classAbstractDBParser- Parameters:
stream- stream to usemetadata- metadata that could be used in parameterizing the connectioncontext- parsecontext that could be used in parameterizing the connection- Returns:
- connection
- Throws:
IOException
-
getConnectionString
protected String getConnectionString(InputStream is, Metadata metadata, ParseContext context) throws IOException Description copied from class:AbstractDBParserImplement for db specific connection information, e.g. "jdbc:sqlite:/docs/mydb.db" Include any optimization settings, user name, password, etc.- Specified by:
getConnectionStringin classAbstractDBParser- Parameters:
is- stream for processingmetadata- metadata might be useful in determining connection infocontext- context to use to help create connectionString- Returns:
- connection string to be used by
AbstractDBParser.getConnection(java.io.InputStream, org.apache.tika.metadata.Metadata, org.apache.tika.parser.ParseContext). - Throws:
IOException
-
close
Description copied from class:AbstractDBParserOverride this for any special handling of closing the connection.- Overrides:
closein classAbstractDBParser- Throws:
SQLExceptionIOException
-
getJDBCClassName
Description copied from class:AbstractDBParserJDBC class name, e.g. org.sqlite.JDBC- Specified by:
getJDBCClassNamein classAbstractDBParser- Returns:
- jdbc class name
-
getTableNames
protected List<String> getTableNames(Connection connection, Metadata metadata, ParseContext context) throws SQLException Description copied from class:AbstractDBParserReturns the names of the tables to process- Specified by:
getTableNamesin classAbstractDBParser- Parameters:
connection- Connection to use to make the sql call(s) to get the names of the tablesmetadata- Metadata to use (potentially) in decision about which tables to extractcontext- ParseContext to use (potentially) in decision about which tables to extract- Returns:
- Throws:
SQLException
-
getTableReader
public JDBCTableReader getTableReader(Connection connection, String tableName, ParseContext context) Description copied from class:AbstractDBParserGiven a connection and a table name, return the JDBCTableReader for this db.- Specified by:
getTableReaderin classAbstractDBParser- Returns:
- a reader
-
getTableReader
protected JDBCTableReader getTableReader(Connection connection, String tableName, EmbeddedDocumentUtil embeddedDocumentUtil) Description copied from class:AbstractDBParserGiven a connection and a table name, return the JDBCTableReader for this db.- Specified by:
getTableReaderin classAbstractDBParserembeddedDocumentUtil- embedded doc util- Returns:
-
extractMetadata
Description copied from class:AbstractDBParserThis is called before parsing the tables to extract metadata from the db, if any. Override this for db specific metadata. This implementation is a no-op- Overrides:
extractMetadatain classAbstractDBParser
-