Go to the documentation of this file.
20package org.sleuthkit.autopsy.datamodel.utils;
23import java.sql.ResultSet;
24import java.sql.SQLException;
25import java.util.HashMap;
27import org.sleuthkit.autopsy.casemodule.Case;
28import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
29import org.sleuthkit.datamodel.SleuthkitCase;
30import org.sleuthkit.datamodel.TskCoreException;
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))";
55 public static Map<Long, String>
getLogicalDataSources(SleuthkitCase tskDb)
throws TskCoreException, SQLException {
57 Map<Long, String> dataSourceMap =
new HashMap<>();
61 ResultSet resultSet = query.getResultSet()) {
62 while (resultSet.next()) {
63 Long objectId = resultSet.getLong(1);
64 String dataSourceName = resultSet.getString(2);
65 dataSourceMap.put(objectId, dataSourceName);
81 public static Map<Long, String>
getImageDataSources(SleuthkitCase tskDb)
throws SQLException, TskCoreException {
83 Map<Long, String> dataSourceMap =
new HashMap<>();
87 ResultSet resultSet = query.getResultSet()) {
89 while (resultSet.next()) {
90 Long objectId = resultSet.getLong(1);
91 if (!dataSourceMap.containsKey(objectId)) {
92 String dataSourceName = resultSet.getString(2);
93 File image =
new File(dataSourceName);
94 String dataSourceNameTrimmed = image.getName();
95 dataSourceMap.put(objectId, dataSourceNameTrimmed);
113 Map<Long, String> dataSourceMap =
new HashMap<>();
122 return dataSourceMap;
SleuthkitCase getSleuthkitCase()
static Case getCurrentCaseThrows()
static final String SELECT_DATA_SOURCES_IMAGE
static Map< Long, String > getLogicalDataSources(SleuthkitCase tskDb)
static Map< Long, String > getAllDataSources()
static Map< Long, String > getImageDataSources(SleuthkitCase tskDb)
static final String SELECT_DATA_SOURCES_LOGICAL
Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.