mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
finds data sources that are images
This commit is contained in:
parent
15cf059d0b
commit
7fc4912ba2
@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.commonfilesearch;
|
package org.sleuthkit.autopsy.commonfilesearch;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -91,7 +92,9 @@ public final class CommonFilesPanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
new SwingWorker<Map<Long, String>, Void>() {
|
new SwingWorker<Map<Long, String>, Void>() {
|
||||||
|
|
||||||
private static final String SELECT_DATA_SOURCES = "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))";
|
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))";
|
||||||
|
|
||||||
|
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))";
|
||||||
|
|
||||||
private void updateUi() {
|
private void updateUi() {
|
||||||
|
|
||||||
@ -132,7 +135,7 @@ public final class CommonFilesPanel extends javax.swing.JPanel {
|
|||||||
SleuthkitCase tskDb = currentCase.getSleuthkitCase();
|
SleuthkitCase tskDb = currentCase.getSleuthkitCase();
|
||||||
|
|
||||||
//try block releases resources - exceptions are handled in done()
|
//try block releases resources - exceptions are handled in done()
|
||||||
try (CaseDbQuery query = tskDb.executeQuery(SELECT_DATA_SOURCES)) {
|
try (CaseDbQuery query = tskDb.executeQuery(SELECT_DATA_SOURCES_LOGICAL)) {
|
||||||
ResultSet resultSet = query.getResultSet();
|
ResultSet resultSet = query.getResultSet();
|
||||||
while (resultSet.next()) {
|
while (resultSet.next()) {
|
||||||
Long objectId = resultSet.getLong(1);
|
Long objectId = resultSet.getLong(1);
|
||||||
@ -141,6 +144,17 @@ public final class CommonFilesPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try (CaseDbQuery query = tskDb.executeQuery(SELECT_DATA_SOURCES_IMAGE)){
|
||||||
|
ResultSet resultSet = query.getResultSet();
|
||||||
|
while(resultSet.next()){
|
||||||
|
Long objectId = resultSet.getLong(1);
|
||||||
|
String dataSourceName = resultSet.getString(2);
|
||||||
|
File image = new File(dataSourceName);
|
||||||
|
String dataSourceNameTrimmed = image.getName();
|
||||||
|
dataSouceMap.put(objectId, dataSourceNameTrimmed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return dataSouceMap;
|
return dataSouceMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user