Autopsy
4.12.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
|
Inherits AutoCloseable.
Classes | |
class | Builder |
Public Member Functions | |
void | close () throws SQLiteTableReaderException |
int | getColumnCount (String tableName) throws SQLiteTableReaderException |
int | getRowCount (String tableName) throws SQLiteTableReaderException |
List< String > | getTableNames () throws SQLiteTableReaderException |
boolean | isFinished () |
void | read (String tableName) throws SQLiteTableReaderException |
void | read (String tableName, int limit, int offset) throws SQLiteTableReaderException |
void | read (String tableName, BooleanSupplier condition) throws SQLiteTableReaderException |
Protected Member Functions | |
void | finalize () throws Throwable |
Private Member Functions | |
SQLiteTableReader (Builder builder) | |
void | closeTableResources () |
String | copyFileToTempDirectory (AbstractFile file, long fileId) throws IOException, NoCurrentCaseException |
void | ensureOpen () throws SQLiteTableReaderException |
void | findAndCopySQLiteMetaFile (AbstractFile sqliteFile, String metaFileName) throws NoCurrentCaseException, TskCoreException, IOException |
void | openTableResources (String query) throws SQLiteTableReaderException |
void | readHelper (String query, BooleanSupplier condition) throws SQLiteTableReaderException |
Private Attributes | |
final Builder | builder |
int | columnNameIndex |
Connection | conn |
ResultSetMetaData | currentMetadata |
int | currRowColumnIndex |
final AbstractFile | file |
boolean | liveResultSet |
String | prevTableName |
ResultSet | queryResults |
PreparedStatement | statement |
int | totalColumnCount |
boolean | unfinishedRow |
Static Private Attributes | |
static final Logger | logger = Logger.getLogger(SQLiteTableReader.class.getName()) |
static final String | SELECT_ALL_QUERY = "SELECT * FROM \"%s\"" |
Reads through SQLite tables row by row. Functions performed on the data must be declared up front to the Builder. For example:
tableReader = new SQLiteTableReader.Builder(file).forAllColumnNames(System.out::println); tableReader.read("Sample Table X");
By declaring the functions up front, the SQLiteTableReader instance can stream the table contents in the most memory efficient manner.
Definition at line 54 of file SQLiteTableReader.java.
|
private |
Holds reference to the builder instance so that we can use its actions during iteration.
Definition at line 218 of file SQLiteTableReader.java.
References org.sleuthkit.autopsy.coreutils.SQLiteTableReader.builder, and org.sleuthkit.autopsy.coreutils.SQLiteTableReader.Builder.file.
Referenced by org.sleuthkit.autopsy.coreutils.SQLiteTableReader.Builder.build().
void org.sleuthkit.autopsy.coreutils.SQLiteTableReader.close | ( | ) | throws SQLiteTableReaderException |
Closes all resources attached to the database file.
SQLiteTableReaderException |
Definition at line 512 of file SQLiteTableReader.java.
Referenced by org.sleuthkit.autopsy.textextractors.SqliteTextExtractor.SQLiteStreamReader.close(), and org.sleuthkit.autopsy.coreutils.SQLiteTableReader.finalize().
|
private |
Ensures both the statement and the result set for a table are closed.
Definition at line 492 of file SQLiteTableReader.java.
Referenced by org.sleuthkit.autopsy.coreutils.SQLiteTableReader.read(), and org.sleuthkit.autopsy.coreutils.SQLiteTableReader.readHelper().
|
private |
Copies the file contents into a unique path in the current case temp directory.
file | AbstractFile from the data source |
fileId | The input files id value |
IOException | Exception writing file contents |
NoCurrentCaseException | Current case closed during file copying |
Definition at line 457 of file SQLiteTableReader.java.
References org.sleuthkit.autopsy.casemodule.Case.getCurrentCaseThrows(), org.sleuthkit.autopsy.casemodule.Case.getTempDirectory(), and org.sleuthkit.autopsy.datamodel.ContentUtils.writeToFile().
Referenced by org.sleuthkit.autopsy.coreutils.SQLiteTableReader.ensureOpen(), and org.sleuthkit.autopsy.coreutils.SQLiteTableReader.findAndCopySQLiteMetaFile().
|
private |
Ensures that the underlying database connection is open. This entails copying the abstract file contents to temp directory, copying over any WAL or SHM files and getting the connection from the DriverManager.
SQLiteTableReaderException |
Definition at line 397 of file SQLiteTableReader.java.
References org.sleuthkit.autopsy.coreutils.SQLiteTableReader.copyFileToTempDirectory(), and org.sleuthkit.autopsy.coreutils.SQLiteTableReader.findAndCopySQLiteMetaFile().
Referenced by org.sleuthkit.autopsy.coreutils.SQLiteTableReader.getColumnCount(), org.sleuthkit.autopsy.coreutils.SQLiteTableReader.getRowCount(), org.sleuthkit.autopsy.coreutils.SQLiteTableReader.getTableNames(), and org.sleuthkit.autopsy.coreutils.SQLiteTableReader.openTableResources().
|
protected |
Last ditch effort to close the connections during garbage collection.
Throwable |
Definition at line 537 of file SQLiteTableReader.java.
References org.sleuthkit.autopsy.coreutils.SQLiteTableReader.close().
|
private |
Searches for a meta file associated with the give SQLite database. If found, it copies this file into the temp directory of the current case.
sqliteFile | file being processed |
metaFileName | name of meta file to look for |
NoCurrentCaseException | Case has been closed. |
TskCoreException | fileManager cannot find AbstractFile files. |
IOException | Issue during writing to file. |
Definition at line 426 of file SQLiteTableReader.java.
References org.sleuthkit.autopsy.coreutils.SQLiteTableReader.copyFileToTempDirectory(), org.sleuthkit.autopsy.casemodule.services.FileManager.findFiles(), org.sleuthkit.autopsy.casemodule.Case.getCurrentCaseThrows(), org.sleuthkit.autopsy.casemodule.services.Services.getFileManager(), and org.sleuthkit.autopsy.casemodule.Case.getSleuthkitCase().
Referenced by org.sleuthkit.autopsy.coreutils.SQLiteTableReader.ensureOpen().
int org.sleuthkit.autopsy.coreutils.SQLiteTableReader.getColumnCount | ( | String | tableName | ) | throws SQLiteTableReaderException |
Fetches the column count of the table.
tableName | Source table to count |
SQLiteTableReaderException |
Definition at line 275 of file SQLiteTableReader.java.
References org.sleuthkit.autopsy.coreutils.SQLiteTableReader.ensureOpen().
Referenced by org.sleuthkit.autopsy.textextractors.SqliteTextExtractor.SQLiteStreamReader.read().
int org.sleuthkit.autopsy.coreutils.SQLiteTableReader.getRowCount | ( | String | tableName | ) | throws SQLiteTableReaderException |
Fetches the row count.
tableName | Source table to count |
SQLiteTableReaderException |
Definition at line 255 of file SQLiteTableReader.java.
References org.sleuthkit.autopsy.coreutils.SQLiteTableReader.ensureOpen().
List<String> org.sleuthkit.autopsy.coreutils.SQLiteTableReader.getTableNames | ( | ) | throws SQLiteTableReaderException |
Fetches all table names from the database.
SQLiteTableReaderException |
Definition at line 231 of file SQLiteTableReader.java.
References org.sleuthkit.autopsy.coreutils.SQLiteTableReader.ensureOpen().
Referenced by org.sleuthkit.autopsy.textextractors.SqliteTextExtractor.SQLiteStreamReader.read().
boolean org.sleuthkit.autopsy.coreutils.SQLiteTableReader.isFinished | ( | ) |
Provides status of the current read operation.
Definition at line 527 of file SQLiteTableReader.java.
References org.sleuthkit.autopsy.coreutils.SQLiteTableReader.liveResultSet.
Referenced by org.sleuthkit.autopsy.textextractors.SqliteTextExtractor.SQLiteStreamReader.read().
|
private |
Executes the query and assigns resource references to instance variables.
query | Input query to execute |
SQLiteTableReaderException |
Definition at line 476 of file SQLiteTableReader.java.
References org.sleuthkit.autopsy.coreutils.SQLiteTableReader.ensureOpen().
Referenced by org.sleuthkit.autopsy.coreutils.SQLiteTableReader.readHelper().
void org.sleuthkit.autopsy.coreutils.SQLiteTableReader.read | ( | String | tableName | ) | throws SQLiteTableReaderException |
Reads column names and values from the table. Only actions that were configured in the Builder will be invoked during iteration. Iteration will stop when the table read has completed or an exception was encountered.
tableName | Source table to read |
SQLiteTableReaderException |
Definition at line 295 of file SQLiteTableReader.java.
References org.sleuthkit.autopsy.coreutils.SQLiteTableReader.readHelper().
Referenced by org.sleuthkit.autopsy.textextractors.SqliteTextExtractor.SQLiteStreamReader.read().
void org.sleuthkit.autopsy.coreutils.SQLiteTableReader.read | ( | String | tableName, |
int | limit, | ||
int | offset | ||
) | throws SQLiteTableReaderException |
Reads column names and values from the table. Only actions that were configured in the Builder will be invoked during iteration. Iteration will stop when the table read has completed or an exception was encountered.
tableName | Source table to perform a read |
limit | Number of rows to read from the table |
offset | Starting row to read from in the table |
SQLiteTableReaderException |
Definition at line 312 of file SQLiteTableReader.java.
References org.sleuthkit.autopsy.coreutils.SQLiteTableReader.readHelper().
void org.sleuthkit.autopsy.coreutils.SQLiteTableReader.read | ( | String | tableName, |
BooleanSupplier | condition | ||
) | throws SQLiteTableReaderException |
Reads column names and values from the table. Iteration will stop when the condition is true.
tableName | Source table to perform a read |
condition | Condition to stop iteration when true |
SQLiteTableReaderException |
Definition at line 327 of file SQLiteTableReader.java.
References org.sleuthkit.autopsy.coreutils.SQLiteTableReader.closeTableResources(), and org.sleuthkit.autopsy.coreutils.SQLiteTableReader.readHelper().
|
private |
Performs the result set iteration and is responsible for maintaining state of the read over multiple invocations.
SQLiteTableReaderException |
Definition at line 341 of file SQLiteTableReader.java.
References org.sleuthkit.autopsy.coreutils.SQLiteTableReader.closeTableResources(), org.sleuthkit.autopsy.coreutils.SQLiteTableReader.Builder.forAllBlobValuesConsumer, org.sleuthkit.autopsy.coreutils.SQLiteTableReader.Builder.forAllColumnNamesConsumer, org.sleuthkit.autopsy.coreutils.SQLiteTableReader.Builder.forAllFloatValuesConsumer, org.sleuthkit.autopsy.coreutils.SQLiteTableReader.Builder.forAllIntegerValuesConsumer, org.sleuthkit.autopsy.coreutils.SQLiteTableReader.Builder.forAllLongValuesConsumer, org.sleuthkit.autopsy.coreutils.SQLiteTableReader.Builder.forAllStringValuesConsumer, org.sleuthkit.autopsy.coreutils.SQLiteTableReader.Builder.forAllTableValuesConsumer, org.sleuthkit.autopsy.coreutils.SQLiteTableReader.openTableResources(), and org.sleuthkit.autopsy.coreutils.SQLiteTableReader.totalColumnCount.
Referenced by org.sleuthkit.autopsy.coreutils.SQLiteTableReader.read().
|
private |
Definition at line 196 of file SQLiteTableReader.java.
Referenced by org.sleuthkit.autopsy.coreutils.SQLiteTableReader.SQLiteTableReader().
|
private |
Definition at line 208 of file SQLiteTableReader.java.
|
private |
Definition at line 201 of file SQLiteTableReader.java.
|
private |
Definition at line 204 of file SQLiteTableReader.java.
|
private |
Definition at line 207 of file SQLiteTableReader.java.
|
private |
Definition at line 195 of file SQLiteTableReader.java.
|
private |
Definition at line 211 of file SQLiteTableReader.java.
Referenced by org.sleuthkit.autopsy.coreutils.SQLiteTableReader.isFinished().
|
staticprivate |
Definition at line 199 of file SQLiteTableReader.java.
|
private |
Definition at line 212 of file SQLiteTableReader.java.
|
private |
Definition at line 203 of file SQLiteTableReader.java.
|
staticprivate |
Definition at line 198 of file SQLiteTableReader.java.
|
private |
Definition at line 202 of file SQLiteTableReader.java.
|
private |
Definition at line 209 of file SQLiteTableReader.java.
Referenced by org.sleuthkit.autopsy.coreutils.SQLiteTableReader.readHelper().
|
private |
Definition at line 210 of file SQLiteTableReader.java.
Copyright © 2012-2018 Basis Technology. Generated on: Wed Sep 18 2019
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.