Autopsy  4.17.0
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 
43  @NbBundle.Messages({"ViewArtifactInTimelineAction.displayName=View Result in Timeline... "})
44  public ViewArtifactInTimelineAction(BlackboardArtifact artifact) {
45  super(Bundle.ViewArtifactInTimelineAction_displayName());
46  this.artifact = artifact;
47  // If timeline functionality is not available this action is disabled.
48  if ("false".equals(ModuleSettings.getConfigSetting("timeline", "enable_timeline"))) {
49  setEnabled(false);
50  }
51  }
52 
53  @Override
54  public void actionPerformed(ActionEvent e) {
55  try {
56  SystemAction.get(OpenTimelineAction.class).showArtifactInTimeline(artifact);
57  } catch (TskCoreException ex) {
58  MessageNotifyUtil.Message.error("Error opening Timeline");
59  logger.log(Level.SEVERE, "Error showing timeline.", ex);
60  }
61  }
62 
70  public static boolean hasSupportedTimeStamp(BlackboardArtifact artifact) throws TskCoreException {
71 
72  for (BlackboardAttribute attr : artifact.getAttributes()) {
73  if (attr.getValueType() == BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DATETIME) {
74  return true;
75  }
76  }
77  return false;
78  }
79 }
static synchronized String getConfigSetting(String moduleName, String settingName)
synchronized static Logger getLogger(String name)
Definition: Logger.java:124

Copyright © 2012-2021 Basis Technology. Generated on: Tue Jan 19 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.