Go to the documentation of this file.
19package org.sleuthkit.autopsy.contentviewers.osaccount;
21import java.awt.BorderLayout;
22import java.awt.Component;
23import java.beans.PropertyChangeEvent;
24import java.beans.PropertyChangeListener;
25import java.util.Optional;
26import java.util.logging.Level;
27import org.openide.nodes.Node;
28import org.openide.util.NbBundle.Messages;
29import org.openide.util.lookup.ServiceProvider;
30import org.sleuthkit.autopsy.contentviewers.utils.ViewerPriority;
31import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer;
32import org.sleuthkit.autopsy.coreutils.Logger;
33import org.sleuthkit.datamodel.AbstractFile;
34import org.sleuthkit.datamodel.DataArtifact;
35import org.sleuthkit.datamodel.OsAccount;
36import org.sleuthkit.datamodel.TskCoreException;
60 Long osAccountId =
null;
62 OsAccount osAccount = node.getLookup().lookup(OsAccount.class);
63 if (osAccount !=
null) {
68 Optional<Long> optional;
69 AbstractFile file = node.getLookup().lookup(AbstractFile.class);
71 optional = file.getOsAccountObjectId();
72 if (optional.isPresent()) {
73 osAccountId = optional.get();
77 if (osAccountId ==
null) {
78 DataArtifact dataArtifact = node.getLookup().lookup(DataArtifact.class);
79 if (dataArtifact !=
null) {
80 optional = dataArtifact.getOsAccountObjectId();
81 if (optional.isPresent()) {
82 osAccountId = optional.get();
87 }
catch (TskCoreException ex) {
88 logger.log(Level.SEVERE, String.format(
"Failed to get OsAccount for node %s", node.getDisplayName()), ex);
91 if (osAccountId !=
null) {
97 "OsAccountViewer_title=OS Account"
101 return Bundle.OsAccountViewer_title();
105 "OsAccountViewer_tooltip=Viewer for Operating System accounts related to the selected node."
109 return Bundle.OsAccountViewer_tooltip();
129 AbstractFile file = node.getLookup().lookup(AbstractFile.class);
130 OsAccount osAccount = node.getLookup().lookup(OsAccount.class);
131 DataArtifact dataArtifact = node.getLookup().lookup(DataArtifact.class);
134 return osAccount !=
null
135 || (file !=
null && file.getOsAccountObjectId().isPresent())
136 || (dataArtifact !=
null && dataArtifact.getOsAccountObjectId().isPresent());
137 }
catch (TskCoreException ex) {
138 logger.log(Level.SEVERE, String.format(
"Failed to determine if node %s is Supported for OsAccountViewer", node.getDisplayName()), ex);
153 @SuppressWarnings(
"unchecked")
156 java.awt.GridBagConstraints gridBagConstraints;
160 setLayout(
new java.awt.GridBagLayout());
163 gridBagConstraints =
new java.awt.GridBagConstraints();
164 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
165 gridBagConstraints.weightx = 1.0;
166 gridBagConstraints.weighty = 1.0;
javax.swing.JScrollPane mainScrollPane
boolean isSupported(Node node)
int isPreferred(Node node)
DataContentViewer createInstance()
static final Logger logger
static final long serialVersionUID
final OsAccountDataPanel dataPanel
synchronized static Logger getLogger(String name)
Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.