mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
merge from develop
This commit is contained in:
commit
5ea72a518b
@ -31,7 +31,9 @@ import javax.swing.JOptionPane;
|
|||||||
import javax.swing.event.ListSelectionEvent;
|
import javax.swing.event.ListSelectionEvent;
|
||||||
import javax.swing.table.AbstractTableModel;
|
import javax.swing.table.AbstractTableModel;
|
||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
|
import static org.sleuthkit.autopsy.casemodule.Case.Events.CURRENT_CASE;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
|
import org.sleuthkit.autopsy.events.AutopsyEvent;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.datamodel.IngestJobInfo;
|
import org.sleuthkit.datamodel.IngestJobInfo;
|
||||||
import org.sleuthkit.datamodel.IngestModuleInfo;
|
import org.sleuthkit.datamodel.IngestModuleInfo;
|
||||||
@ -47,6 +49,8 @@ public final class IngestJobInfoPanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(IngestJobInfoPanel.class.getName());
|
private static final Logger logger = Logger.getLogger(IngestJobInfoPanel.class.getName());
|
||||||
private static final Set<IngestManager.IngestJobEvent> INGEST_JOB_EVENTS_OF_INTEREST = EnumSet.of(IngestManager.IngestJobEvent.STARTED, IngestManager.IngestJobEvent.CANCELLED, IngestManager.IngestJobEvent.COMPLETED);
|
private static final Set<IngestManager.IngestJobEvent> INGEST_JOB_EVENTS_OF_INTEREST = EnumSet.of(IngestManager.IngestJobEvent.STARTED, IngestManager.IngestJobEvent.CANCELLED, IngestManager.IngestJobEvent.COMPLETED);
|
||||||
|
private static final Set<Case.Events> CASE_EVENTS_OF_INTEREST = EnumSet.of(Case.Events.CURRENT_CASE);
|
||||||
|
|
||||||
private List<IngestJobInfo> ingestJobs;
|
private List<IngestJobInfo> ingestJobs;
|
||||||
private final List<IngestJobInfo> ingestJobsForSelectedDataSource = new ArrayList<>();
|
private final List<IngestJobInfo> ingestJobsForSelectedDataSource = new ArrayList<>();
|
||||||
private IngestJobTableModel ingestJobTableModel = new IngestJobTableModel();
|
private IngestJobTableModel ingestJobTableModel = new IngestJobTableModel();
|
||||||
@ -79,6 +83,16 @@ public final class IngestJobInfoPanel extends javax.swing.JPanel {
|
|||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Case.addEventTypeSubscriber(CASE_EVENTS_OF_INTEREST, (PropertyChangeEvent evt) -> {
|
||||||
|
if (!(evt instanceof AutopsyEvent) || (((AutopsyEvent) evt).getSourceType() != AutopsyEvent.SourceType.LOCAL)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CURRENT_CASE == Case.Events.valueOf(evt.getPropertyName())) {
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -110,9 +124,15 @@ public final class IngestJobInfoPanel extends javax.swing.JPanel {
|
|||||||
*/
|
*/
|
||||||
private void refresh() {
|
private void refresh() {
|
||||||
try {
|
try {
|
||||||
|
if (Case.isCaseOpen()) {
|
||||||
SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase();
|
SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase();
|
||||||
this.ingestJobs = skCase.getIngestJobs();
|
this.ingestJobs = skCase.getIngestJobs();
|
||||||
setDataSource(selectedDataSource);
|
setDataSource(selectedDataSource);
|
||||||
|
} else {
|
||||||
|
this.ingestJobs = new ArrayList<>();
|
||||||
|
setDataSource(null);
|
||||||
|
}
|
||||||
|
|
||||||
} catch (TskCoreException | NoCurrentCaseException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "Failed to load ingest jobs.", ex);
|
logger.log(Level.SEVERE, "Failed to load ingest jobs.", ex);
|
||||||
JOptionPane.showMessageDialog(this, Bundle.IngestJobInfoPanel_loadIngestJob_error_text(), Bundle.IngestJobInfoPanel_loadIngestJob_error_title(), JOptionPane.ERROR_MESSAGE);
|
JOptionPane.showMessageDialog(this, Bundle.IngestJobInfoPanel_loadIngestJob_error_text(), Bundle.IngestJobInfoPanel_loadIngestJob_error_title(), JOptionPane.ERROR_MESSAGE);
|
||||||
|
@ -304,7 +304,7 @@ final class DataSourceInfoUtilities {
|
|||||||
* @return The concatenated string or null if the query could not be
|
* @return The concatenated string or null if the query could not be
|
||||||
* executed.
|
* executed.
|
||||||
*/
|
*/
|
||||||
private static String getConcattedStringQuery(String query, String valueParam, String separator, String errorMessage, String singleErrorMessage) {
|
private static String getConcattedStringsResult(String query, String valueParam, String separator, String errorMessage, String singleErrorMessage) {
|
||||||
ResultSetHandler<String> handler = (resultSet) -> {
|
ResultSetHandler<String> handler = (resultSet) -> {
|
||||||
String toRet = "";
|
String toRet = "";
|
||||||
boolean first = true;
|
boolean first = true;
|
||||||
@ -350,7 +350,7 @@ final class DataSourceInfoUtilities {
|
|||||||
String errorMessage = "Unable to execute query to retrieve concatted attribute values.";
|
String errorMessage = "Unable to execute query to retrieve concatted attribute values.";
|
||||||
String singleErrorMessage = "There was an error retrieving one of the results. That result will be omitted from concatted value.";
|
String singleErrorMessage = "There was an error retrieving one of the results. That result will be omitted from concatted value.";
|
||||||
String separator = ", ";
|
String separator = ", ";
|
||||||
return getConcattedStringQuery(query, valueParam, separator, errorMessage, singleErrorMessage);
|
return getConcattedStringsResult(query, valueParam, separator, errorMessage, singleErrorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
package org.sleuthkit.autopsy.casemodule.datasourcesummary;
|
package org.sleuthkit.autopsy.casemodule.datasourcesummary;
|
||||||
|
|
||||||
import javax.swing.JTabbedPane;
|
import javax.swing.JTabbedPane;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
|
||||||
import org.sleuthkit.autopsy.casemodule.IngestJobInfoPanel;
|
import org.sleuthkit.autopsy.casemodule.IngestJobInfoPanel;
|
||||||
import org.sleuthkit.datamodel.DataSource;
|
import org.sleuthkit.datamodel.DataSource;
|
||||||
|
|
||||||
@ -31,13 +30,10 @@ import org.sleuthkit.datamodel.DataSource;
|
|||||||
public class DataSourceSummaryTabbedPane extends JTabbedPane {
|
public class DataSourceSummaryTabbedPane extends JTabbedPane {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private final DataSourceSummaryCountsPanel countsPanel;
|
private final DataSourceSummaryCountsPanel countsPanel;
|
||||||
private final DataSourceSummaryDetailsPanel detailsPanel;
|
private final DataSourceSummaryDetailsPanel detailsPanel;
|
||||||
private final DataSourceSummaryUserActivityPanel userActivityPanel;
|
private final IngestJobInfoPanel ingestHistoryPanel;
|
||||||
|
|
||||||
// ingest panel requires an open case in order to properly initialize.
|
|
||||||
// So it will be instantiated when a data source is selected.
|
|
||||||
private IngestJobInfoPanel ingestHistoryPanel = null;
|
|
||||||
|
|
||||||
private DataSource dataSource = null;
|
private DataSource dataSource = null;
|
||||||
|
|
||||||
@ -47,34 +43,11 @@ public class DataSourceSummaryTabbedPane extends JTabbedPane {
|
|||||||
public DataSourceSummaryTabbedPane() {
|
public DataSourceSummaryTabbedPane() {
|
||||||
countsPanel = new DataSourceSummaryCountsPanel();
|
countsPanel = new DataSourceSummaryCountsPanel();
|
||||||
detailsPanel = new DataSourceSummaryDetailsPanel();
|
detailsPanel = new DataSourceSummaryDetailsPanel();
|
||||||
userActivityPanel = new DataSourceSummaryUserActivityPanel();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set tabs to the details panel, counts panel, and ingest history panel. If
|
|
||||||
* no data source or case is closed, no tabs will be shwon.
|
|
||||||
*
|
|
||||||
* @param dataSource The data source to display.
|
|
||||||
*/
|
|
||||||
private void setTabs(DataSource dataSource) {
|
|
||||||
this.removeAll();
|
|
||||||
if (dataSource != null && Case.isCaseOpen()) {
|
|
||||||
addTab(Bundle.DataSourceSummaryDialog_detailsTab_title(), detailsPanel);
|
|
||||||
detailsPanel.setDataSource(dataSource);
|
|
||||||
|
|
||||||
addTab(Bundle.DataSourceSummaryDialog_countsTab_title(), countsPanel);
|
|
||||||
countsPanel.setDataSource(dataSource);
|
|
||||||
|
|
||||||
addTab(Bundle.DataSourceSummaryUserActivityPanel_tab_title(), userActivityPanel);
|
|
||||||
userActivityPanel.setDataSource(dataSource);
|
|
||||||
|
|
||||||
if (ingestHistoryPanel == null) {
|
|
||||||
ingestHistoryPanel = new IngestJobInfoPanel();
|
ingestHistoryPanel = new IngestJobInfoPanel();
|
||||||
}
|
|
||||||
|
|
||||||
|
addTab(Bundle.DataSourceSummaryDialog_detailsTab_title(), detailsPanel);
|
||||||
|
addTab(Bundle.DataSourceSummaryDialog_countsTab_title(), countsPanel);
|
||||||
addTab(Bundle.DataSourceSummaryDialog_ingestHistoryTab_title(), ingestHistoryPanel);
|
addTab(Bundle.DataSourceSummaryDialog_ingestHistoryTab_title(), ingestHistoryPanel);
|
||||||
ingestHistoryPanel.setDataSource(dataSource);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -93,6 +66,9 @@ public class DataSourceSummaryTabbedPane extends JTabbedPane {
|
|||||||
*/
|
*/
|
||||||
public void setDataSource(DataSource dataSource) {
|
public void setDataSource(DataSource dataSource) {
|
||||||
this.dataSource = dataSource;
|
this.dataSource = dataSource;
|
||||||
setTabs(dataSource);
|
|
||||||
|
detailsPanel.setDataSource(dataSource);
|
||||||
|
countsPanel.setDataSource(dataSource);
|
||||||
|
ingestHistoryPanel.setDataSource(dataSource);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ import javax.swing.table.DefaultTableModel;
|
|||||||
* A Table model where cells are not editable.
|
* A Table model where cells are not editable.
|
||||||
*/
|
*/
|
||||||
class NonEditableTableModel extends DefaultTableModel {
|
class NonEditableTableModel extends DefaultTableModel {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
NonEditableTableModel(Object[][] data, Object[] columnNames) {
|
NonEditableTableModel(Object[][] data, Object[] columnNames) {
|
||||||
super(data, columnNames);
|
super(data, columnNames);
|
||||||
|
@ -109,10 +109,12 @@ public class SaveSnapshotAsReport extends Action {
|
|||||||
|
|
||||||
String reportName = JOptionPane.showInputDialog(SwingUtilities.windowForComponent(controller.getTopComponent()), message,
|
String reportName = JOptionPane.showInputDialog(SwingUtilities.windowForComponent(controller.getTopComponent()), message,
|
||||||
Bundle.SaveSnapShotAsReport_action_dialogs_title(), JOptionPane.QUESTION_MESSAGE);
|
Bundle.SaveSnapShotAsReport_action_dialogs_title(), JOptionPane.QUESTION_MESSAGE);
|
||||||
|
// if reportName is null then cancel was selected, if reportName is empty then ok was selected and no report name specified
|
||||||
|
if (reportName != null) {
|
||||||
reportName = StringUtils.defaultIfBlank(reportName, defaultReportName);
|
reportName = StringUtils.defaultIfBlank(reportName, defaultReportName);
|
||||||
|
|
||||||
createReport(controller, reportName, generationDate, snapshot);
|
createReport(controller, reportName, generationDate, snapshot);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -272,6 +272,8 @@ final class ExtractPrefetch extends Extract {
|
|||||||
new BlackboardAttribute(
|
new BlackboardAttribute(
|
||||||
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME, getName(),
|
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME, getName(),
|
||||||
applicationName),//NON-NLS
|
applicationName),//NON-NLS
|
||||||
|
new BlackboardAttribute(
|
||||||
|
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH, getName(), filePath),
|
||||||
new BlackboardAttribute(
|
new BlackboardAttribute(
|
||||||
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME, getName(),
|
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME, getName(),
|
||||||
executionTime),
|
executionTime),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user