From 1ea1d24d699d700d75ab5d26d611dfa4f5255cdc Mon Sep 17 00:00:00 2001 From: esaunders Date: Mon, 24 Jul 2017 16:39:14 -0400 Subject: [PATCH] Pass Content object through to ResultsTableArtifact to eliminate unnecessary database queries and File object creation. --- .../corecomponents/DataContentViewerArtifact.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerArtifact.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerArtifact.java index 2c9fa00b0d..f80866ac9b 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerArtifact.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerArtifact.java @@ -491,18 +491,19 @@ public class DataContentViewerArtifact extends javax.swing.JPanel implements Dat private final SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private String[][] rowData = null; private final String artifactDisplayName; + private final Content content; - ResultsTableArtifact(BlackboardArtifact artifact) { + ResultsTableArtifact(BlackboardArtifact artifact, Content content) { artifactDisplayName = artifact.getDisplayName(); + this.content = content; addRows(artifact); - } ResultsTableArtifact(String errorMsg) { artifactDisplayName = errorMsg; rowData = new String[1][3]; rowData[0] = new String[]{"", errorMsg, ""}; - + content = null; } private String[][] getRows() { @@ -512,7 +513,6 @@ public class DataContentViewerArtifact extends javax.swing.JPanel implements Dat private void addRows(BlackboardArtifact artifact) { List rowsToAdd = new ArrayList<>(); try { - Content content = artifact.getSleuthkitCase().getContentById(artifact.getObjectID()); /* * Add rows for each attribute. */ @@ -716,7 +716,7 @@ public class DataContentViewerArtifact extends javax.swing.JPanel implements Dat // Build the new artifact contents cache. ArrayList artifactContents = new ArrayList<>(); for (BlackboardArtifact artifact : artifacts) { - artifactContents.add(new ResultsTableArtifact(artifact)); + artifactContents.add(new ResultsTableArtifact(artifact, content)); } // If the node has an underlying blackboard artifact, show it. If not,