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