19 package org.sleuthkit.autopsy.communications.relationships;
21 import java.beans.PropertyChangeEvent;
22 import java.util.List;
23 import java.util.logging.Level;
24 import org.openide.explorer.ExplorerManager;
25 import org.openide.nodes.Node;
33 import static org.
sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_ASSOCIATED_OBJECT;
47 final class MessageDataContent
extends MessageArtifactViewer implements DataContent, ExplorerManager.Provider {
49 private static final Logger LOGGER = Logger.getLogger(MessageDataContent.class.getName());
51 private static final long serialVersionUID = 1L;
52 final private ExplorerManager explorerManager =
new ExplorerManager();
55 public void propertyChange(
final PropertyChangeEvent evt) {
56 throw new UnsupportedOperationException(
"Not supported yet.");
60 public ExplorerManager getExplorerManager() {
61 return explorerManager;
65 public void setNode(Node node) {
66 BlackboardArtifact artifact = null;
68 artifact = getNodeArtifact(node);
85 private BlackboardArtifact getNodeArtifact(Node node) {
86 BlackboardArtifact nodeArtifact = node.getLookup().lookup(BlackboardArtifact.class);
88 if (nodeArtifact == null) {
90 SleuthkitCase tskCase = Case.getCurrentCaseThrows().getSleuthkitCase();
91 AbstractFile file = node.getLookup().lookup(AbstractFile.class);
93 List<BlackboardArtifact> artifactsList = tskCase.getBlackboardArtifacts(TSK_ASSOCIATED_OBJECT, file.getId());
95 for (BlackboardArtifact fileArtifact : artifactsList) {
96 BlackboardAttribute associatedArtifactAttribute = fileArtifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT));
97 if (associatedArtifactAttribute != null) {
98 BlackboardArtifact associatedArtifact = fileArtifact.getSleuthkitCase().getBlackboardArtifact(associatedArtifactAttribute.getValueLong());
100 nodeArtifact = associatedArtifact;
105 }
catch (NoCurrentCaseException | TskCoreException ex) {
106 LOGGER.log(Level.SEVERE,
"Failed to get file for selected node.", ex);
void setArtifact(BlackboardArtifact artifact)
static boolean isMessageArtifact(BlackboardArtifact nodeArtifact)