mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 16:36:15 +00:00
New panel for type filtering in the geolocation tool
This commit is contained in:
parent
496939e684
commit
c51a586984
@ -28,6 +28,7 @@ import org.sleuthkit.autopsy.geolocation.datamodel.GeoLocationDataException;
|
|||||||
import org.sleuthkit.autopsy.geolocation.datamodel.Track;
|
import org.sleuthkit.autopsy.geolocation.datamodel.Track;
|
||||||
import org.sleuthkit.autopsy.geolocation.datamodel.Waypoint;
|
import org.sleuthkit.autopsy.geolocation.datamodel.Waypoint;
|
||||||
import org.sleuthkit.autopsy.geolocation.datamodel.WaypointBuilder;
|
import org.sleuthkit.autopsy.geolocation.datamodel.WaypointBuilder;
|
||||||
|
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The business logic for filtering waypoints.
|
* The business logic for filtering waypoints.
|
||||||
@ -60,6 +61,7 @@ abstract class AbstractWaypointFetcher implements WaypointBuilder.WaypointFilter
|
|||||||
Case currentCase = Case.getCurrentCase();
|
Case currentCase = Case.getCurrentCase();
|
||||||
WaypointBuilder.getAllWaypoints(currentCase.getSleuthkitCase(),
|
WaypointBuilder.getAllWaypoints(currentCase.getSleuthkitCase(),
|
||||||
filters.getDataSources(),
|
filters.getDataSources(),
|
||||||
|
filters.getArtifactTypes(),
|
||||||
filters.showAllWaypoints(),
|
filters.showAllWaypoints(),
|
||||||
filters.getMostRecentNumDays(),
|
filters.getMostRecentNumDays(),
|
||||||
filters.showWaypointsWithoutTimeStamp(),
|
filters.showWaypointsWithoutTimeStamp(),
|
||||||
@ -77,12 +79,13 @@ abstract class AbstractWaypointFetcher implements WaypointBuilder.WaypointFilter
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(List<Waypoint> waypoints) {
|
public void process(List<Waypoint> waypoints) {
|
||||||
|
|
||||||
List<Track> tracks = null;
|
List<Track> tracks = null;
|
||||||
try {
|
if (filters.getArtifactTypes().contains(ARTIFACT_TYPE.TSK_GPS_TRACK)) {
|
||||||
tracks = Track.getTracks(Case.getCurrentCase().getSleuthkitCase(), filters.getDataSources());
|
try {
|
||||||
} catch (GeoLocationDataException ex) {
|
tracks = Track.getTracks(Case.getCurrentCase().getSleuthkitCase(), filters.getDataSources());
|
||||||
logger.log(Level.WARNING, "Exception thrown while retrieving list of Tracks", ex);
|
} catch (GeoLocationDataException ex) {
|
||||||
|
logger.log(Level.WARNING, "Exception thrown while retrieving list of Tracks", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Waypoint> completeList = createWaypointList(waypoints, tracks);
|
List<Waypoint> completeList = createWaypointList(waypoints, tracks);
|
||||||
|
@ -15,7 +15,7 @@ GeoFilterPanel.daysLabel.text=days of activity
|
|||||||
CheckBoxListPanel.titleLabel.text=jLabel1
|
CheckBoxListPanel.titleLabel.text=jLabel1
|
||||||
CheckBoxListPanel.checkButton.text=Check All
|
CheckBoxListPanel.checkButton.text=Check All
|
||||||
CheckBoxListPanel.uncheckButton.text=Uncheck All
|
CheckBoxListPanel.uncheckButton.text=Uncheck All
|
||||||
GeoFilterPanel.optionsLabel.text=Waypoints
|
GeoFilterPanel.optionsLabel.text=Dates
|
||||||
OptionsCategory_Name_Geolocation=Geolocation
|
OptionsCategory_Name_Geolocation=Geolocation
|
||||||
OptionsCategory_Keywords_Geolocation=Geolocation Settings
|
OptionsCategory_Keywords_Geolocation=Geolocation Settings
|
||||||
GeolocationSettingsPanel.tilePane.border.title=Map Tile Data Source
|
GeolocationSettingsPanel.tilePane.border.title=Map Tile Data Source
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
CTL_OpenGeolocation=Geolocation
|
CTL_OpenGeolocation=Geolocation
|
||||||
CTL_GeolocationTopComponentAction=GeolocationTopComponent
|
CTL_GeolocationTopComponentAction=GeolocationTopComponent
|
||||||
CTL_GeolocationTopComponent=Geolocation
|
CTL_GeolocationTopComponent=Geolocation
|
||||||
|
GeoFilterPanel_ArtifactType_List_Title=Types
|
||||||
GeoFilterPanel_DataSource_List_Title=Data Sources
|
GeoFilterPanel_DataSource_List_Title=Data Sources
|
||||||
|
GeoFilterPanel_empty_artifactType=Type list is empty.
|
||||||
GeoFilterPanel_empty_dataSource=Data Source list is empty.
|
GeoFilterPanel_empty_dataSource=Data Source list is empty.
|
||||||
GeolocationSettings_mbtile_does_not_exist_message=The file supplied does not exist.\nPlease verify that the file exists and try again.
|
GeolocationSettings_mbtile_does_not_exist_message=The file supplied does not exist.\nPlease verify that the file exists and try again.
|
||||||
GeolocationSettings_mbtile_does_not_exist_title=File Not Found
|
GeolocationSettings_mbtile_does_not_exist_title=File Not Found
|
||||||
@ -52,7 +54,7 @@ GeoFilterPanel.daysLabel.text=days of activity
|
|||||||
CheckBoxListPanel.titleLabel.text=jLabel1
|
CheckBoxListPanel.titleLabel.text=jLabel1
|
||||||
CheckBoxListPanel.checkButton.text=Check All
|
CheckBoxListPanel.checkButton.text=Check All
|
||||||
CheckBoxListPanel.uncheckButton.text=Uncheck All
|
CheckBoxListPanel.uncheckButton.text=Uncheck All
|
||||||
GeoFilterPanel.optionsLabel.text=Waypoints
|
GeoFilterPanel.optionsLabel.text=Dates
|
||||||
OptionsCategory_Name_Geolocation=Geolocation
|
OptionsCategory_Name_Geolocation=Geolocation
|
||||||
OptionsCategory_Keywords_Geolocation=Geolocation Settings
|
OptionsCategory_Keywords_Geolocation=Geolocation Settings
|
||||||
GeolocationSettingsPanel.tilePane.border.title=Map Tile Data Source
|
GeolocationSettingsPanel.tilePane.border.title=Map Tile Data Source
|
||||||
|
@ -22,7 +22,9 @@ import java.awt.GridBagConstraints;
|
|||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import javafx.util.Pair;
|
import javafx.util.Pair;
|
||||||
@ -33,6 +35,7 @@ import org.openide.util.NbBundle.Messages;
|
|||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
|
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
||||||
import org.sleuthkit.datamodel.DataSource;
|
import org.sleuthkit.datamodel.DataSource;
|
||||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
@ -49,24 +52,26 @@ class GeoFilterPanel extends javax.swing.JPanel {
|
|||||||
private static final Logger logger = Logger.getLogger(GeoFilterPanel.class.getName());
|
private static final Logger logger = Logger.getLogger(GeoFilterPanel.class.getName());
|
||||||
|
|
||||||
private final SpinnerNumberModel numberModel;
|
private final SpinnerNumberModel numberModel;
|
||||||
private final CheckBoxListPanel<DataSource> checkboxPanel;
|
private final CheckBoxListPanel<DataSource> dsCheckboxPanel;
|
||||||
|
private final CheckBoxListPanel<ARTIFACT_TYPE> atCheckboxPanel;
|
||||||
|
|
||||||
// Make sure to update if
|
// Make sure to update if
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private static final BlackboardArtifact.ARTIFACT_TYPE[] GPS_ARTIFACT_TYPES = {
|
private static final ARTIFACT_TYPE[] GPS_ARTIFACT_TYPES = {
|
||||||
BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_BOOKMARK,
|
ARTIFACT_TYPE.TSK_GPS_BOOKMARK,
|
||||||
BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_LAST_KNOWN_LOCATION,
|
ARTIFACT_TYPE.TSK_GPS_LAST_KNOWN_LOCATION,
|
||||||
BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_ROUTE,
|
ARTIFACT_TYPE.TSK_GPS_ROUTE,
|
||||||
BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_SEARCH,
|
ARTIFACT_TYPE.TSK_GPS_SEARCH,
|
||||||
BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_TRACK,
|
ARTIFACT_TYPE.TSK_GPS_TRACK,
|
||||||
BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_TRACKPOINT
|
ARTIFACT_TYPE.TSK_GPS_TRACKPOINT
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new GeoFilterPanel
|
* Creates new GeoFilterPanel
|
||||||
*/
|
*/
|
||||||
@Messages({
|
@Messages({
|
||||||
"GeoFilterPanel_DataSource_List_Title=Data Sources"
|
"GeoFilterPanel_DataSource_List_Title=Data Sources",
|
||||||
|
"GeoFilterPanel_ArtifactType_List_Title=Types"
|
||||||
})
|
})
|
||||||
GeoFilterPanel() {
|
GeoFilterPanel() {
|
||||||
// numberModel is used in initComponents
|
// numberModel is used in initComponents
|
||||||
@ -76,10 +81,15 @@ class GeoFilterPanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
// The gui builder cannot handle using CheckBoxListPanel due to its
|
// The gui builder cannot handle using CheckBoxListPanel due to its
|
||||||
// use of generics so we will initalize it here.
|
// use of generics so we will initalize it here.
|
||||||
checkboxPanel = new CheckBoxListPanel<>();
|
dsCheckboxPanel = new CheckBoxListPanel<>();
|
||||||
checkboxPanel.setPanelTitle(Bundle.GeoFilterPanel_DataSource_List_Title());
|
dsCheckboxPanel.setPanelTitle(Bundle.GeoFilterPanel_DataSource_List_Title());
|
||||||
checkboxPanel.setPanelTitleIcon(new ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/image.png")));
|
dsCheckboxPanel.setPanelTitleIcon(new ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/image.png")));
|
||||||
checkboxPanel.setSetAllSelected(true);
|
dsCheckboxPanel.setSetAllSelected(true);
|
||||||
|
|
||||||
|
atCheckboxPanel = new CheckBoxListPanel<>();
|
||||||
|
atCheckboxPanel.setPanelTitle(Bundle.GeoFilterPanel_ArtifactType_List_Title());
|
||||||
|
atCheckboxPanel.setPanelTitleIcon(new ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/extracted_content.png")));
|
||||||
|
atCheckboxPanel.setSetAllSelected(true);
|
||||||
|
|
||||||
GridBagConstraints gridBagConstraints = new GridBagConstraints();
|
GridBagConstraints gridBagConstraints = new GridBagConstraints();
|
||||||
gridBagConstraints.gridx = 0;
|
gridBagConstraints.gridx = 0;
|
||||||
@ -89,7 +99,17 @@ class GeoFilterPanel extends javax.swing.JPanel {
|
|||||||
gridBagConstraints.weightx = 1.0;
|
gridBagConstraints.weightx = 1.0;
|
||||||
gridBagConstraints.weighty = 1.0;
|
gridBagConstraints.weighty = 1.0;
|
||||||
gridBagConstraints.insets = new java.awt.Insets(0, 15, 0, 15);
|
gridBagConstraints.insets = new java.awt.Insets(0, 15, 0, 15);
|
||||||
add(checkboxPanel, gridBagConstraints);
|
add(dsCheckboxPanel, gridBagConstraints);
|
||||||
|
|
||||||
|
gridBagConstraints = new GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 0;
|
||||||
|
gridBagConstraints.gridy = 4;
|
||||||
|
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||||
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||||
|
gridBagConstraints.weightx = 1.0;
|
||||||
|
gridBagConstraints.weighty = 1.0;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(0, 15, 0, 15);
|
||||||
|
add(atCheckboxPanel, gridBagConstraints);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -98,7 +118,8 @@ class GeoFilterPanel extends javax.swing.JPanel {
|
|||||||
mostRecentButton.setEnabled(enabled);
|
mostRecentButton.setEnabled(enabled);
|
||||||
allButton.setEnabled(enabled);
|
allButton.setEnabled(enabled);
|
||||||
showWaypointsWOTSCheckBox.setEnabled(enabled && mostRecentButton.isSelected());
|
showWaypointsWOTSCheckBox.setEnabled(enabled && mostRecentButton.isSelected());
|
||||||
checkboxPanel.setEnabled(enabled);
|
dsCheckboxPanel.setEnabled(enabled);
|
||||||
|
atCheckboxPanel.setEnabled(enabled);
|
||||||
daysLabel.setEnabled(enabled);
|
daysLabel.setEnabled(enabled);
|
||||||
daysSpinner.setEnabled(enabled);
|
daysSpinner.setEnabled(enabled);
|
||||||
}
|
}
|
||||||
@ -115,11 +136,12 @@ class GeoFilterPanel extends javax.swing.JPanel {
|
|||||||
* Clears the data source list.
|
* Clears the data source list.
|
||||||
*/
|
*/
|
||||||
void clearDataSourceList() {
|
void clearDataSourceList() {
|
||||||
checkboxPanel.clearList();
|
dsCheckboxPanel.clearList();
|
||||||
|
atCheckboxPanel.clearList();
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean hasDataSources() {
|
boolean hasDataSources() {
|
||||||
return !checkboxPanel.isEmpty();
|
return !dsCheckboxPanel.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -139,18 +161,24 @@ class GeoFilterPanel extends javax.swing.JPanel {
|
|||||||
* @throws GeoLocationUIException
|
* @throws GeoLocationUIException
|
||||||
*/
|
*/
|
||||||
@Messages({
|
@Messages({
|
||||||
"GeoFilterPanel_empty_dataSource=Data Source list is empty."
|
"GeoFilterPanel_empty_dataSource=Data Source list is empty.",
|
||||||
|
"GeoFilterPanel_empty_artifactType=Type list is empty."
|
||||||
})
|
})
|
||||||
GeoFilter getFilterState() throws GeoLocationUIException {
|
GeoFilter getFilterState() throws GeoLocationUIException {
|
||||||
List<DataSource> dataSources = checkboxPanel.getSelectedElements();
|
List<DataSource> dataSources = dsCheckboxPanel.getSelectedElements();
|
||||||
|
List<ARTIFACT_TYPE> artifactTypes = atCheckboxPanel.getSelectedElements();
|
||||||
|
|
||||||
if (dataSources.isEmpty()) {
|
if (dataSources.isEmpty()) {
|
||||||
throw new GeoLocationUIException(Bundle.GeoFilterPanel_empty_dataSource());
|
throw new GeoLocationUIException(Bundle.GeoFilterPanel_empty_dataSource());
|
||||||
}
|
}
|
||||||
|
if (artifactTypes.isEmpty()) {
|
||||||
|
throw new GeoLocationUIException(Bundle.GeoFilterPanel_empty_artifactType());
|
||||||
|
}
|
||||||
return new GeoFilter(allButton.isSelected(),
|
return new GeoFilter(allButton.isSelected(),
|
||||||
showWaypointsWOTSCheckBox.isSelected(),
|
showWaypointsWOTSCheckBox.isSelected(),
|
||||||
numberModel.getNumber().intValue(),
|
numberModel.getNumber().intValue(),
|
||||||
dataSources);
|
dataSources,
|
||||||
|
artifactTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -312,6 +340,7 @@ class GeoFilterPanel extends javax.swing.JPanel {
|
|||||||
private final boolean showWithoutTimeStamp;
|
private final boolean showWithoutTimeStamp;
|
||||||
private final int mostRecentNumDays;
|
private final int mostRecentNumDays;
|
||||||
private final List<DataSource> dataSources;
|
private final List<DataSource> dataSources;
|
||||||
|
private final List<ARTIFACT_TYPE> artifactTypes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a Geolocation filter. showAll and mostRecentNumDays are
|
* Construct a Geolocation filter. showAll and mostRecentNumDays are
|
||||||
@ -332,12 +361,17 @@ class GeoFilterPanel extends javax.swing.JPanel {
|
|||||||
* showAll is true.
|
* showAll is true.
|
||||||
* @param dataSources A list of dataSources to filter waypoint
|
* @param dataSources A list of dataSources to filter waypoint
|
||||||
* for.
|
* for.
|
||||||
|
* @param artifactTypes A list of artifactTypes to filter waypoint
|
||||||
|
* for.
|
||||||
*/
|
*/
|
||||||
GeoFilter(boolean showAll, boolean withoutTimeStamp, int mostRecentNumDays, List<DataSource> dataSources) {
|
GeoFilter(boolean showAll, boolean withoutTimeStamp,
|
||||||
|
int mostRecentNumDays, List<DataSource> dataSources,
|
||||||
|
List<ARTIFACT_TYPE> artifactTypes) {
|
||||||
this.showAll = showAll;
|
this.showAll = showAll;
|
||||||
this.showWithoutTimeStamp = withoutTimeStamp;
|
this.showWithoutTimeStamp = withoutTimeStamp;
|
||||||
this.mostRecentNumDays = mostRecentNumDays;
|
this.mostRecentNumDays = mostRecentNumDays;
|
||||||
this.dataSources = dataSources;
|
this.dataSources = dataSources;
|
||||||
|
this.artifactTypes = artifactTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -380,6 +414,28 @@ class GeoFilterPanel extends javax.swing.JPanel {
|
|||||||
List<DataSource> getDataSources() {
|
List<DataSource> getDataSources() {
|
||||||
return Collections.unmodifiableList(dataSources);
|
return Collections.unmodifiableList(dataSources);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a list of artifact types to filter the waypoints by, or null
|
||||||
|
* if all types should be include.
|
||||||
|
*
|
||||||
|
* @return A list of artifactTypes or null if all artifactTypes should
|
||||||
|
* be included.
|
||||||
|
*/
|
||||||
|
List<ARTIFACT_TYPE> getArtifactTypes() {
|
||||||
|
return Collections.unmodifiableList(artifactTypes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final private class Sources {
|
||||||
|
final List<Pair<String, DataSource>> dataSources;
|
||||||
|
final HashMap<ARTIFACT_TYPE, Long> artifactTypes;
|
||||||
|
|
||||||
|
private Sources(List<Pair<String, DataSource>> dataSources,
|
||||||
|
HashMap<ARTIFACT_TYPE, Long> artifactTypes) {
|
||||||
|
this.dataSources = dataSources;
|
||||||
|
this.artifactTypes = artifactTypes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -388,21 +444,27 @@ class GeoFilterPanel extends javax.swing.JPanel {
|
|||||||
* doInBackground creates a list of Pair objects that contain the
|
* doInBackground creates a list of Pair objects that contain the
|
||||||
* display name of the data source and the data source object.
|
* display name of the data source and the data source object.
|
||||||
*/
|
*/
|
||||||
final private class DataSourceUpdater extends SwingWorker<List<Pair<String, DataSource>>, Void> {
|
final private class DataSourceUpdater extends SwingWorker<Sources, Void> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<Pair<String, DataSource>> doInBackground() throws Exception {
|
protected Sources doInBackground() throws Exception {
|
||||||
SleuthkitCase sleuthkitCase = Case.getCurrentCase().getSleuthkitCase();
|
SleuthkitCase sleuthkitCase = Case.getCurrentCase().getSleuthkitCase();
|
||||||
List<Pair<String, DataSource>> validSources = new ArrayList<>();
|
List<Pair<String, DataSource>> validSources = new ArrayList<>();
|
||||||
|
HashMap<ARTIFACT_TYPE, Long> atCountsTotal = new HashMap<>();
|
||||||
|
|
||||||
for (DataSource dataSource : sleuthkitCase.getDataSources()) {
|
for (DataSource dataSource : sleuthkitCase.getDataSources()) {
|
||||||
if (isGPSDataSource(sleuthkitCase, dataSource)) {
|
HashMap<ARTIFACT_TYPE, Long> atCounts = getGPSDataSources(sleuthkitCase, dataSource);
|
||||||
|
if (!atCounts.isEmpty()) {
|
||||||
|
for (Map.Entry<ARTIFACT_TYPE, Long> entry : atCounts.entrySet()) {
|
||||||
|
atCountsTotal.putIfAbsent(entry.getKey(), 0L);
|
||||||
|
atCountsTotal.put(entry.getKey(), atCountsTotal.get(entry.getKey()) + entry.getValue());
|
||||||
|
}
|
||||||
String dsName = sleuthkitCase.getContentById(dataSource.getId()).getName();
|
String dsName = sleuthkitCase.getContentById(dataSource.getId()).getName();
|
||||||
Pair<String, DataSource> pair = new Pair<>(dsName, dataSource);
|
Pair<String, DataSource> pair = new Pair<>(dsName, dataSource);
|
||||||
validSources.add(pair);
|
validSources.add(pair);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return new Sources(validSources, atCountsTotal);
|
||||||
return validSources;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -415,19 +477,20 @@ class GeoFilterPanel extends javax.swing.JPanel {
|
|||||||
*
|
*
|
||||||
* @throws TskCoreException
|
* @throws TskCoreException
|
||||||
*/
|
*/
|
||||||
private boolean isGPSDataSource(SleuthkitCase sleuthkitCase, DataSource dataSource) throws TskCoreException {
|
private HashMap<ARTIFACT_TYPE, Long> getGPSDataSources(SleuthkitCase sleuthkitCase, DataSource dataSource) throws TskCoreException {
|
||||||
|
HashMap<ARTIFACT_TYPE, Long> ret = new HashMap<>();
|
||||||
for (BlackboardArtifact.ARTIFACT_TYPE type : GPS_ARTIFACT_TYPES) {
|
for (BlackboardArtifact.ARTIFACT_TYPE type : GPS_ARTIFACT_TYPES) {
|
||||||
if (sleuthkitCase.getBlackboardArtifactsTypeCount(type.getTypeID(), dataSource.getId()) > 0) {
|
long count = sleuthkitCase.getBlackboardArtifactsTypeCount(type.getTypeID(), dataSource.getId());
|
||||||
return true;
|
if (count > 0) {
|
||||||
|
ret.put(type, count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return ret;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void done() {
|
public void done() {
|
||||||
List<Pair<String, DataSource>> sources = null;
|
Sources sources = null;
|
||||||
try {
|
try {
|
||||||
sources = get();
|
sources = get();
|
||||||
} catch (InterruptedException | ExecutionException ex) {
|
} catch (InterruptedException | ExecutionException ex) {
|
||||||
@ -440,8 +503,12 @@ class GeoFilterPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sources != null) {
|
if (sources != null) {
|
||||||
for (Pair<String, DataSource> source : sources) {
|
for (Pair<String, DataSource> source : sources.dataSources) {
|
||||||
checkboxPanel.addElement(source.getKey(), source.getValue());
|
dsCheckboxPanel.addElement(source.getKey(), source.getValue());
|
||||||
|
}
|
||||||
|
for (Map.Entry<ARTIFACT_TYPE, Long> entry : sources.artifactTypes.entrySet()) {
|
||||||
|
String dispName = entry.getKey().getDisplayName() + " (" + entry.getValue() + ")";
|
||||||
|
atCheckboxPanel.addElement(dispName, entry.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +166,6 @@ public final class GeolocationTopComponent extends TopComponent {
|
|||||||
Bundle.GLTopComponent_No_dataSource_message(),
|
Bundle.GLTopComponent_No_dataSource_message(),
|
||||||
Bundle.GLTopComponent_No_dataSource_Title(),
|
Bundle.GLTopComponent_No_dataSource_Title(),
|
||||||
JOptionPane.ERROR_MESSAGE);
|
JOptionPane.ERROR_MESSAGE);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,7 +289,7 @@ public final class GeolocationTopComponent extends TopComponent {
|
|||||||
filters = geoFilterPanel.getFilterState();
|
filters = geoFilterPanel.getFilterState();
|
||||||
} catch (GeoLocationUIException ex) {
|
} catch (GeoLocationUIException ex) {
|
||||||
JOptionPane.showMessageDialog(this,
|
JOptionPane.showMessageDialog(this,
|
||||||
Bundle.GeoTopComponent_filer_data_invalid_msg(),
|
ex.getMessage(),
|
||||||
Bundle.GeoTopComponent_filer_data_invalid_Title(),
|
Bundle.GeoTopComponent_filer_data_invalid_Title(),
|
||||||
JOptionPane.INFORMATION_MESSAGE);
|
JOptionPane.INFORMATION_MESSAGE);
|
||||||
return;
|
return;
|
||||||
|
@ -26,6 +26,7 @@ import java.util.List;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
|
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
||||||
import org.sleuthkit.datamodel.CaseDbAccessManager;
|
import org.sleuthkit.datamodel.CaseDbAccessManager;
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||||
@ -189,7 +190,7 @@ public final class WaypointBuilder {
|
|||||||
public static List<Waypoint> getTrackpointWaypoints(SleuthkitCase skCase) throws GeoLocationDataException {
|
public static List<Waypoint> getTrackpointWaypoints(SleuthkitCase skCase) throws GeoLocationDataException {
|
||||||
List<BlackboardArtifact> artifacts = null;
|
List<BlackboardArtifact> artifacts = null;
|
||||||
try {
|
try {
|
||||||
artifacts = skCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_TRACKPOINT);
|
artifacts = skCase.getBlackboardArtifacts(ARTIFACT_TYPE.TSK_GPS_TRACKPOINT);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
throw new GeoLocationDataException("Unable to get artifacts for type: TSK_GPS_TRACKPOINT", ex);//NON-NLS
|
throw new GeoLocationDataException("Unable to get artifacts for type: TSK_GPS_TRACKPOINT", ex);//NON-NLS
|
||||||
}
|
}
|
||||||
@ -237,7 +238,7 @@ public final class WaypointBuilder {
|
|||||||
static public List<Waypoint> getEXIFWaypoints(SleuthkitCase skCase) throws GeoLocationDataException {
|
static public List<Waypoint> getEXIFWaypoints(SleuthkitCase skCase) throws GeoLocationDataException {
|
||||||
List<BlackboardArtifact> artifacts = null;
|
List<BlackboardArtifact> artifacts = null;
|
||||||
try {
|
try {
|
||||||
artifacts = skCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_METADATA_EXIF);
|
artifacts = skCase.getBlackboardArtifacts(ARTIFACT_TYPE.TSK_METADATA_EXIF);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
throw new GeoLocationDataException("Unable to get artifacts for type: TSK_GPS_LAST_KNOWN_LOCATION", ex);//NON-NLS
|
throw new GeoLocationDataException("Unable to get artifacts for type: TSK_GPS_LAST_KNOWN_LOCATION", ex);//NON-NLS
|
||||||
}
|
}
|
||||||
@ -289,7 +290,7 @@ public final class WaypointBuilder {
|
|||||||
public static List<Waypoint> getSearchWaypoints(SleuthkitCase skCase) throws GeoLocationDataException {
|
public static List<Waypoint> getSearchWaypoints(SleuthkitCase skCase) throws GeoLocationDataException {
|
||||||
List<BlackboardArtifact> artifacts = null;
|
List<BlackboardArtifact> artifacts = null;
|
||||||
try {
|
try {
|
||||||
artifacts = skCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_SEARCH);
|
artifacts = skCase.getBlackboardArtifacts(ARTIFACT_TYPE.TSK_GPS_SEARCH);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
throw new GeoLocationDataException("Unable to get artifacts for type: TSK_GPS_SEARCH", ex);//NON-NLS
|
throw new GeoLocationDataException("Unable to get artifacts for type: TSK_GPS_SEARCH", ex);//NON-NLS
|
||||||
}
|
}
|
||||||
@ -339,7 +340,7 @@ public final class WaypointBuilder {
|
|||||||
public static List<Waypoint> getLastKnownWaypoints(SleuthkitCase skCase) throws GeoLocationDataException {
|
public static List<Waypoint> getLastKnownWaypoints(SleuthkitCase skCase) throws GeoLocationDataException {
|
||||||
List<BlackboardArtifact> artifacts = null;
|
List<BlackboardArtifact> artifacts = null;
|
||||||
try {
|
try {
|
||||||
artifacts = skCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_LAST_KNOWN_LOCATION);
|
artifacts = skCase.getBlackboardArtifacts(ARTIFACT_TYPE.TSK_GPS_LAST_KNOWN_LOCATION);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
throw new GeoLocationDataException("Unable to get artifacts for type: TSK_GPS_LAST_KNOWN_LOCATION", ex);//NON-NLS
|
throw new GeoLocationDataException("Unable to get artifacts for type: TSK_GPS_LAST_KNOWN_LOCATION", ex);//NON-NLS
|
||||||
}
|
}
|
||||||
@ -390,7 +391,7 @@ public final class WaypointBuilder {
|
|||||||
public static List<Waypoint> getBookmarkWaypoints(SleuthkitCase skCase) throws GeoLocationDataException {
|
public static List<Waypoint> getBookmarkWaypoints(SleuthkitCase skCase) throws GeoLocationDataException {
|
||||||
List<BlackboardArtifact> artifacts = null;
|
List<BlackboardArtifact> artifacts = null;
|
||||||
try {
|
try {
|
||||||
artifacts = skCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_BOOKMARK);
|
artifacts = skCase.getBlackboardArtifacts(ARTIFACT_TYPE.TSK_GPS_BOOKMARK);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
throw new GeoLocationDataException("Unable to get artifacts for type: TSK_GPS_BOOKMARK", ex);//NON-NLS
|
throw new GeoLocationDataException("Unable to get artifacts for type: TSK_GPS_BOOKMARK", ex);//NON-NLS
|
||||||
}
|
}
|
||||||
@ -459,7 +460,7 @@ public final class WaypointBuilder {
|
|||||||
*
|
*
|
||||||
* @throws GeoLocationDataException
|
* @throws GeoLocationDataException
|
||||||
*/
|
*/
|
||||||
static public void getAllWaypoints(SleuthkitCase skCase, List<DataSource> dataSources, boolean showAll, int cntDaysFromRecent, boolean noTimeStamp, WaypointFilterQueryCallBack queryCallBack) throws GeoLocationDataException {
|
static public void getAllWaypoints(SleuthkitCase skCase, List<DataSource> dataSources, List<ARTIFACT_TYPE> artifactTypes, boolean showAll, int cntDaysFromRecent, boolean noTimeStamp, WaypointFilterQueryCallBack queryCallBack) throws GeoLocationDataException {
|
||||||
String query = buildQuery(dataSources, showAll, cntDaysFromRecent, noTimeStamp);
|
String query = buildQuery(dataSources, showAll, cntDaysFromRecent, noTimeStamp);
|
||||||
|
|
||||||
logger.log(Level.INFO, query);
|
logger.log(Level.INFO, query);
|
||||||
@ -480,9 +481,10 @@ public final class WaypointBuilder {
|
|||||||
int artifact_type_id = rs.getInt("artifact_type_id"); //NON-NLS
|
int artifact_type_id = rs.getInt("artifact_type_id"); //NON-NLS
|
||||||
long artifact_id = rs.getLong("artifact_id"); //NON-NLS
|
long artifact_id = rs.getLong("artifact_id"); //NON-NLS
|
||||||
|
|
||||||
BlackboardArtifact.ARTIFACT_TYPE type = BlackboardArtifact.ARTIFACT_TYPE.fromID(artifact_type_id);
|
ARTIFACT_TYPE type = ARTIFACT_TYPE.fromID(artifact_type_id);
|
||||||
|
if (artifactTypes.contains(type)) {
|
||||||
waypoints.addAll(getWaypointForArtifact(skCase.getBlackboardArtifact(artifact_id), type));
|
waypoints.addAll(getWaypointForArtifact(skCase.getBlackboardArtifact(artifact_id), type));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
queryCallBack.process(waypoints);
|
queryCallBack.process(waypoints);
|
||||||
@ -624,7 +626,7 @@ public final class WaypointBuilder {
|
|||||||
*
|
*
|
||||||
* @throws GeoLocationDataException
|
* @throws GeoLocationDataException
|
||||||
*/
|
*/
|
||||||
static private List<Waypoint> getWaypointForArtifact(BlackboardArtifact artifact, BlackboardArtifact.ARTIFACT_TYPE type) throws GeoLocationDataException {
|
static private List<Waypoint> getWaypointForArtifact(BlackboardArtifact artifact, ARTIFACT_TYPE type) throws GeoLocationDataException {
|
||||||
List<Waypoint> waypoints = new ArrayList<>();
|
List<Waypoint> waypoints = new ArrayList<>();
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TSK_METADATA_EXIF:
|
case TSK_METADATA_EXIF:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user