19 package org.sleuthkit.autopsy.datamodel;
21 import java.beans.PropertyChangeEvent;
22 import java.beans.PropertyChangeListener;
23 import java.util.ArrayList;
24 import java.util.Collections;
25 import java.util.Comparator;
26 import java.util.HashMap;
27 import java.util.List;
28 import java.util.logging.Level;
29 import org.openide.nodes.ChildFactory;
30 import org.openide.nodes.Children;
31 import org.openide.nodes.Node;
32 import org.openide.nodes.Sheet;
33 import org.openide.util.NbBundle;
34 import org.openide.util.lookup.Lookups;
58 public static final String
NAME = NbBundle.getMessage(
RootNode.class,
"ExtractedContentNode.name.text");
73 static String getIconFilePath(
int typeID) {
74 String filePath =
"org/sleuthkit/autopsy/images/";
76 return filePath +
"bookmarks.png";
77 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID()) {
78 return filePath +
"cookies.png";
79 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY.getTypeID()) {
80 return filePath +
"history.png";
81 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD.getTypeID()) {
82 return filePath +
"downloads.png";
83 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_RECENT_OBJECT.getTypeID()) {
84 return filePath +
"recent_docs.png";
85 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_TRACKPOINT.getTypeID()) {
86 return filePath +
"gps_trackpoint.png";
87 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_INSTALLED_PROG.getTypeID()) {
88 return filePath +
"programs.png";
89 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_DEVICE_ATTACHED.getTypeID()) {
90 return filePath +
"usb_devices.png";
91 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG.getTypeID()) {
92 return filePath +
"mail-icon-16.png";
93 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_EXTRACTED_TEXT.getTypeID()) {
94 return filePath +
"text-file.png";
95 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID()) {
96 return filePath +
"searchquery.png";
97 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_METADATA_EXIF.getTypeID()) {
98 return filePath +
"camera-icon-16.png";
99 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_OS_INFO.getTypeID()) {
100 return filePath +
"computer.png";
101 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_SERVICE_ACCOUNT.getTypeID()) {
102 return filePath +
"account-icon-16.png";
103 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_CONTACT.getTypeID()) {
104 return filePath +
"contact.png";
105 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_MESSAGE.getTypeID()) {
106 return filePath +
"message.png";
107 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_CALLLOG.getTypeID()) {
108 return filePath +
"calllog.png";
109 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_CALENDAR_ENTRY.getTypeID()) {
110 return filePath +
"calendar.png";
111 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_SPEED_DIAL_ENTRY.getTypeID()) {
112 return filePath +
"speeddialentry.png";
113 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_BLUETOOTH_PAIRING.getTypeID()) {
114 return filePath +
"bluetooth.png";
115 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_BOOKMARK.getTypeID()) {
116 return filePath +
"gpsfav.png";
117 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_LAST_KNOWN_LOCATION.getTypeID()) {
118 return filePath +
"gps-lastlocation.png";
119 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_SEARCH.getTypeID()) {
120 return filePath +
"gps-search.png";
121 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_PROG_RUN.getTypeID()) {
122 return filePath +
"installed.png";
123 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED.getTypeID()) {
124 return filePath +
"encrypted-file.png";
125 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_EXT_MISMATCH_DETECTED.getTypeID()) {
126 return filePath +
"mismatch-16.png";
127 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_ROUTE.getTypeID()) {
128 return filePath +
"gps_trackpoint.png";
129 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_REMOTE_DRIVE.getTypeID()) {
130 return filePath +
"drive_network.png";
131 }
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_FACE_DETECTED.getTypeID()) {
132 return filePath +
"face.png";
134 return filePath +
"artifact-icon.png";
140 super(Children.create(
new TypeFactory(),
true), Lookups.singleton(NAME));
142 super.setDisplayName(NAME);
143 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/extracted_content.png");
153 return v.
visit(
this);
158 Sheet s = super.createSheet();
159 Sheet.Set ss = s.get(Sheet.PROPERTIES);
161 ss = Sheet.createPropertiesSet();
165 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"ExtractedContentNode.createSheet.name.name"),
166 NbBundle.getMessage(
this.getClass(),
"ExtractedContentNode.createSheet.name.displayName"),
167 NbBundle.getMessage(
this.getClass(),
"ExtractedContentNode.createSheet.name.desc"),
174 return getClass().getName();
183 private class TypeFactory extends ChildFactory.Detachable<BlackboardArtifact.Type> {
202 private final PropertyChangeListener
pcl = (PropertyChangeEvent evt) -> {
203 String eventType = evt.getPropertyName();
218 if (null != event && !(this.
doNotShow.contains(event.getBlackboardArtifactType()))) {
221 }
catch (IllegalStateException notUsed) {
236 }
catch (IllegalStateException notUsed) {
243 if (evt.getNewValue() == null) {
262 typeNodeList.clear();
266 protected boolean createKeys(List<BlackboardArtifact.Type> list) {
268 if (skCase != null) {
272 Collections.sort(types,
273 new Comparator<BlackboardArtifact.Type>() {
276 return a.getDisplayName().compareTo(b.getDisplayName());
284 TypeNode node = typeNodeList.get(art);
286 node.updateDisplayName();
290 Logger.
getLogger(
TypeFactory.class.getName()).log(Level.SEVERE,
"Error getting list of artifacts in use: " + ex.getLocalizedMessage());
299 typeNodeList.put(key, node);
317 super.setName(
type.getTypeName());
323 final void updateDisplayName() {
324 if (skCase == null) {
333 }
catch (TskException ex) {
334 Logger.getLogger(TypeNode.class.getName())
335 .log(Level.WARNING,
"Error getting child count", ex);
337 super.setDisplayName(
type.
getDisplayName() +
" \u200E(\u200E" + childCount +
")\u200E");
342 Sheet s = super.createSheet();
343 Sheet.Set ss = s.get(Sheet.PROPERTIES);
345 ss = Sheet.createPropertiesSet();
349 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"ArtifactTypeNode.createSheet.artType.name"),
350 NbBundle.getMessage(
this.getClass(),
"ArtifactTypeNode.createSheet.artType.displayName"),
351 NbBundle.getMessage(
this.getClass(),
"ArtifactTypeNode.createSheet.artType.desc"),
354 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"ArtifactTypeNode.createSheet.childCnt.name"),
355 NbBundle.getMessage(
this.getClass(),
"ArtifactTypeNode.createSheet.childCnt.displayName"),
356 NbBundle.getMessage(
this.getClass(),
"ArtifactTypeNode.createSheet.childCnt.desc"),
364 return v.
visit(
this);
390 private final PropertyChangeListener
pcl =
new PropertyChangeListener() {
392 public void propertyChange(PropertyChangeEvent evt) {
393 String eventType = evt.getPropertyName();
410 if (null != event && event.getBlackboardArtifactType().equals(
type)) {
413 }
catch (IllegalStateException notUsed) {
429 }
catch (IllegalStateException notUsed) {
451 protected boolean createKeys(List<BlackboardArtifact> list) {
452 if (skCase != null) {
TSK_INTERESTING_ARTIFACT_HIT
void removeIngestModuleEventListener(final PropertyChangeListener listener)
static synchronized IngestManager getInstance()
ArrayList< BlackboardArtifact > getBlackboardArtifacts(int artifactTypeID)
static void removePropertyChangeListener(PropertyChangeListener listener)
List< BlackboardArtifact.Type > getArtifactTypesInUse()
T visit(DataSourcesNode in)
void removeIngestJobEventListener(final PropertyChangeListener listener)
void addIngestJobEventListener(final PropertyChangeListener listener)
static void addPropertyChangeListener(PropertyChangeListener listener)
long getBlackboardArtifactsTypeCount(int artifactTypeID)
void addIngestModuleEventListener(final PropertyChangeListener listener)
static Case getCurrentCase()
synchronized static Logger getLogger(String name)