Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
ViewArtifactInTimelineAction.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2016 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.timeline.actions;
20 
21 import java.awt.event.ActionEvent;
22 import java.util.logging.Level;
23 import javax.swing.AbstractAction;
24 import org.openide.util.NbBundle;
25 import org.openide.util.actions.SystemAction;
30 import org.sleuthkit.datamodel.BlackboardArtifact;
31 import org.sleuthkit.datamodel.BlackboardAttribute;
32 import org.sleuthkit.datamodel.TskCoreException;
33 
37 public final class ViewArtifactInTimelineAction extends AbstractAction {
38 
39  private static final Logger logger = Logger.getLogger(ViewFileInTimelineAction.class.getName());
40 
41  private final BlackboardArtifact artifact;
42 
47  @NbBundle.Messages({"ViewArtifactInTimelineAction.displayName=View Result in Timeline... "})
48  public ViewArtifactInTimelineAction(BlackboardArtifact artifact) {
49  this(artifact, Bundle.ViewArtifactInTimelineAction_displayName());
50  }
51 
57  public ViewArtifactInTimelineAction(BlackboardArtifact artifact, String displayName) {
58  super(displayName);
59  this.artifact = artifact;
60  // If timeline functionality is not available this action is disabled.
61  if ("false".equals(ModuleSettings.getConfigSetting("timeline", "enable_timeline"))) {
62  setEnabled(false);
63  }
64  }
65 
66  @Override
67  public void actionPerformed(ActionEvent e) {
68  try {
69  SystemAction.get(OpenTimelineAction.class).showArtifactInTimeline(artifact);
70  } catch (TskCoreException ex) {
71  MessageNotifyUtil.Message.error("Error opening Timeline");
72  logger.log(Level.SEVERE, "Error showing timeline.", ex);
73  }
74  }
75 
83  public static boolean hasSupportedTimeStamp(BlackboardArtifact artifact) throws TskCoreException {
84 
85  for (BlackboardAttribute attr : artifact.getAttributes()) {
86  if (attr.getValueType() == BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DATETIME) {
87  return true;
88  }
89  }
90  return false;
91  }
92 }
static synchronized String getConfigSetting(String moduleName, String settingName)
ViewArtifactInTimelineAction(BlackboardArtifact artifact, String displayName)
synchronized static Logger getLogger(String name)
Definition: Logger.java:124

Copyright © 2012-2022 Basis Technology. Generated on: Thu Sep 29 2022
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.