19 package org.sleuthkit.autopsy.directorytree;
21 import java.awt.event.ActionEvent;
22 import java.util.logging.Level;
23 import java.util.logging.Logger;
24 import javax.swing.AbstractAction;
34 class ViewSourceArtifactAction
extends AbstractAction {
36 private static final long serialVersionUID = 1L;
37 private static final Logger logger = Logger.getLogger(ViewSourceArtifactAction.class.getName());
38 private final BlackboardArtifact artifact;
40 ViewSourceArtifactAction(String title,
final BlackboardArtifact artifact) {
42 this.artifact = artifact;
46 public void actionPerformed(ActionEvent e) {
47 final DirectoryTreeTopComponent dirTree = DirectoryTreeTopComponent.findInstance();
49 for (BlackboardAttribute attribute : artifact.getAttributes()) {
50 if (attribute.getAttributeType().getTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT.getTypeID()) {
51 BlackboardArtifact associatedArtifact = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong());
52 if (associatedArtifact != null) {
53 dirTree.viewArtifact(associatedArtifact);
59 }
catch (TskCoreException ex) {
60 logger.log(Level.WARNING,
"Unable to perform view artifact on an associated artifact of " + artifact.getDisplayName(), ex);
65 public Object clone() throws CloneNotSupportedException {