From 50934d7ae67ed0e50ff6c5116147fdef3f15a453 Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Thu, 9 Jun 2016 16:48:42 -0400 Subject: [PATCH 1/4] Show meta information for interesting file hits in HTML report --- .../autopsy/report/TableReportGenerator.java | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java index 16e32b8461..44e0af0432 100755 --- a/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java @@ -59,7 +59,7 @@ class TableReportGenerator { private final TableReportModule tableReport; private final Map> columnHeaderMap; private static final Logger logger = Logger.getLogger(TableReportGenerator.class.getName()); - + private final List errorList; TableReportGenerator(Map artifactTypeSelections, Map tagNameSelections, ReportProgressPanel progressPanel, TableReportModule tableReport) { @@ -899,23 +899,32 @@ class TableReportGenerator { } else if (BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT.getTypeID() == getArtifact().getArtifactTypeID()) { String[] attributeDataArray = new String[3]; - // Array is used so that the order of the attributes is - // maintained. + // Array is used so that order of the attributes is maintained. for (BlackboardAttribute attr : attributes) { if (attr.getAttributeType().equals(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME))) { attributeDataArray[0] = attr.getDisplayString(); } else if (attr.getAttributeType().equals(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_CATEGORY))) { attributeDataArray[1] = attr.getDisplayString(); - } else if (attr.getAttributeType().equals(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH))) { - String pathToShow = attr.getDisplayString(); - if (pathToShow.isEmpty()) { - pathToShow = getFileUniquePath(content); - } - attributeDataArray[2] = pathToShow; } } + + attributeDataArray[2] = content.getUniquePath(); + if (attributeDataArray[2].isEmpty()) { + attributeDataArray[2] = getFileUniquePath(content); + } orderedRowData.addAll(Arrays.asList(attributeDataArray)); - orderedRowData.add(makeCommaSeparatedList(getTags())); + + HashSet allTags = getTags(); + try { + List contentTags = Case.getCurrentCase().getServices().getTagsManager().getContentTagsByContent(content); + for (ContentTag ct : contentTags) { + allTags.add(ct.getName().getDisplayName()); + } + } catch (TskCoreException ex) { + errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetContentTags")); + logger.log(Level.SEVERE, "Failed to get content tags", ex); //NON-NLS + } + orderedRowData.add(makeCommaSeparatedList(allTags)); } else if (columnHeaderMap.containsKey(this.artifact.getArtifactTypeID())) { @@ -1494,7 +1503,7 @@ class TableReportGenerator { return columns; } - + /** * Given a tsk_file's obj_id, return the unique path of that file. * @@ -1516,7 +1525,7 @@ class TableReportGenerator { return ""; } - + /** * Get any tags associated with an artifact * From 333c07a231194df62f53a30eb9b629fde96df52b Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Fri, 10 Jun 2016 09:35:08 -0400 Subject: [PATCH 2/4] code review comments --- .../src/org/sleuthkit/autopsy/report/TableReportGenerator.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java index 44e0af0432..5dd88f680a 100755 --- a/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java @@ -909,9 +909,6 @@ class TableReportGenerator { } attributeDataArray[2] = content.getUniquePath(); - if (attributeDataArray[2].isEmpty()) { - attributeDataArray[2] = getFileUniquePath(content); - } orderedRowData.addAll(Arrays.asList(attributeDataArray)); HashSet allTags = getTags(); From 0454723d36e720a41ed1029a2de35f64d30e25f7 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 10 Jun 2016 09:46:41 -0400 Subject: [PATCH 3/4] Move setting the main window title on case change to the EDT --- Core/src/org/sleuthkit/autopsy/casemodule/Case.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 016c842155..b83346764e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -1533,8 +1533,8 @@ public class Case implements SleuthkitCase.ErrorObserver { // close all top components CoreComponentControl.closeCoreWindows(); } + updateMainWindowTitle(currentCase.getName()); }); - updateMainWindowTitle(currentCase.getName()); } else { SwingUtilities.invokeLater(() -> { Frame f = WindowManager.getDefault().getMainWindow(); From b5c5b2d4f08212333a837f957e212260f6a92870 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 10 Jun 2016 12:25:59 -0400 Subject: [PATCH 4/4] Update for SleuthkitCase public API fix --- Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java index c18440d08d..dc9774ed72 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java @@ -99,7 +99,7 @@ class AddImageTask implements Runnable { List errorMessages = new ArrayList<>(); List newDataSources = new ArrayList<>(); try { - currentCase.getSleuthkitCase().acquireExclusiveLockForSQLite(); + currentCase.getSleuthkitCase().acquireExclusiveLock(); synchronized (tskAddImageProcessLock) { tskAddImageProcess = currentCase.makeAddImageProcess(timeZone, true, ignoreFatOrphanFiles); } @@ -112,7 +112,7 @@ class AddImageTask implements Runnable { commitOrRevertAddImageProcess(currentCase, errorMessages, newDataSources); progressMonitor.setProgress(100); } finally { - currentCase.getSleuthkitCase().releaseExclusiveLockForSQLite(); + currentCase.getSleuthkitCase().releaseExclusiveLock(); DataSourceProcessorCallback.DataSourceProcessorResult result; if (criticalErrorOccurred) { result = DataSourceProcessorResult.CRITICAL_ERRORS;