20 package org.sleuthkit.autopsy.guiutils;
23 import java.sql.ResultSet;
24 import java.sql.SQLException;
25 import java.util.HashMap;
41 private static final String
SELECT_DATA_SOURCES_LOGICAL =
"select obj_id, name from tsk_files where obj_id in (SELECT obj_id FROM tsk_objects WHERE obj_id in (select obj_id from data_source_info))";
43 private static final String
SELECT_DATA_SOURCES_IMAGE =
"select obj_id, name from tsk_image_names where obj_id in (SELECT obj_id FROM tsk_objects WHERE obj_id in (select obj_id from data_source_info))";
45 private void loadLogicalSources(SleuthkitCase tskDb, Map<Long, String> dataSouceMap)
throws TskCoreException, SQLException {
48 SleuthkitCase.CaseDbQuery query = tskDb.executeQuery(SELECT_DATA_SOURCES_LOGICAL);
49 ResultSet resultSet = query.getResultSet()
51 while (resultSet.next()) {
52 Long objectId = resultSet.getLong(1);
53 String dataSourceName = resultSet.getString(2);
54 dataSouceMap.put(objectId, dataSourceName);
59 private void loadImageSources(SleuthkitCase tskDb, Map<Long, String> dataSouceMap)
throws SQLException, TskCoreException {
62 SleuthkitCase.CaseDbQuery query = tskDb.executeQuery(SELECT_DATA_SOURCES_IMAGE);
63 ResultSet resultSet = query.getResultSet()) {
65 while (resultSet.next()) {
66 Long objectId = resultSet.getLong(1);
67 String dataSourceName = resultSet.getString(2);
68 File image =
new File(dataSourceName);
69 String dataSourceNameTrimmed = image.getName();
70 dataSouceMap.put(objectId, dataSourceNameTrimmed);
84 Map<Long, String> dataSouceMap =
new HashMap<>();
static final String SELECT_DATA_SOURCES_IMAGE
Map< Long, String > getDataSourceMap()
void loadImageSources(SleuthkitCase tskDb, Map< Long, String > dataSouceMap)
SleuthkitCase getSleuthkitCase()
static final String SELECT_DATA_SOURCES_LOGICAL
static Case getCurrentCaseThrows()
void loadLogicalSources(SleuthkitCase tskDb, Map< Long, String > dataSouceMap)