19 package org.sleuthkit.autopsy.timeline.events.type;
21 import java.util.Arrays;
22 import java.util.Collections;
23 import java.util.List;
25 import java.util.function.BiFunction;
26 import javafx.scene.image.Image;
27 import org.apache.commons.lang3.StringUtils;
28 import org.openide.util.Exceptions;
29 import org.openide.util.NbBundle;
41 MESSAGE(NbBundle.getMessage(
MiscTypes.class,
"MiscTypes.message.name"),
"message.png",
51 List<String> asList = Arrays.asList(stringValueOf(dir), stringValueOf(readStatus), name != null || phoneNumber != null ? toFrom(dir) :
"", stringValueOf(name != null ? name : phoneNumber), (subject == null ?
"" : stringValueOf(subject)));
52 return StringUtils.join(asList,
" ");
55 GPS_ROUTE(NbBundle.getMessage(
MiscTypes.class,
"MiscTypes.GPSRoutes.name"),
"gps-search.png",
67 GPS_TRACKPOINT(NbBundle.getMessage(
MiscTypes.class,
"MiscTypes.GPSTrackpoint.name"),
"gps-trackpoint.png",
76 (artf, attrMap) ->
""),
77 CALL_LOG(NbBundle.getMessage(
MiscTypes.class,
"MiscTypes.Calls.name"),
"calllog.png",
83 EMAIL(NbBundle.getMessage(
MiscTypes.class,
"MiscTypes.Email.name"),
"mail-icon-16.png",
86 (artifact, attrMap) -> {
93 RECENT_DOCUMENTS(NbBundle.getMessage(
MiscTypes.class,
"MiscTypes.recentDocuments.name"),
"recent_docs.png",
97 (String t) -> (StringUtils.substringBeforeLast(StringUtils.substringBeforeLast(t,
"\\"),
"\\"))),
99 (String t) -> StringUtils.substringBeforeLast(t,
"\\")),
112 String shortDescription = getShortExtractor().apply(artf, attrMap);
113 String medDescription = getMedExtractor().apply(artf, attrMap);
114 String fullDescription = getFullExtractor().apply(artf, attrMap);
119 INSTALLED_PROGRAM(NbBundle.getMessage(
MiscTypes.class,
"MiscTypes.installedPrograms.name"),
"programs.png",
125 EXIF(NbBundle.getMessage(
MiscTypes.class,
"MiscTypes.exif.name"),
"camera-icon-16.png",
137 return " error loading file name";
139 Exceptions.printStackTrace(ex);
140 return " error loading file name";
143 DEVICES_ATTACHED(NbBundle.getMessage(
MiscTypes.class,
"MiscTypes.devicesAttached.name"),
"usb_devices.png",
188 return longExtractor;
198 return shortExtractor;
203 return dateTimeAttributeType;
230 private MiscTypes(String displayName, String iconBase, BlackboardArtifact.ARTIFACT_TYPE artifactType,
232 BiFunction<BlackboardArtifact, Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute>, String> shortExtractor,
233 BiFunction<BlackboardArtifact, Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute>, String> medExtractor,
234 BiFunction<BlackboardArtifact, Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute>, String> longExtractor) {
235 this.displayName = displayName;
236 this.iconBase = iconBase;
237 this.artifactType = artifactType;
238 this.dateTimeAttributeType = dateTimeAttributeType;
239 this.shortExtractor = shortExtractor;
240 this.medExtractor = medExtractor;
241 this.longExtractor = longExtractor;
242 this.image =
new Image(
"org/sleuthkit/autopsy/timeline/images/" + iconBase,
true);
252 return Collections.emptyList();
BlackboardAttribute.ATTRIBUTE_TYPE getDateTimeAttrubuteType()
BiFunction< BlackboardArtifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute >, String > getShortExtractor()
static String toFrom(BlackboardAttribute dir)
MiscTypes(String displayName, String iconBase, BlackboardArtifact.ARTIFACT_TYPE artifactType, BlackboardAttribute.ATTRIBUTE_TYPE dateTimeAttributeType, BiFunction< BlackboardArtifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute >, String > shortExtractor, BiFunction< BlackboardArtifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute >, String > medExtractor, BiFunction< BlackboardArtifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute >, String > longExtractor)
final BiFunction< BlackboardArtifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute >, String > shortExtractor
EventTypeZoomLevel getZoomLevel()
final BlackboardAttribute.ATTRIBUTE_TYPE dateTimeAttributeType
SleuthkitCase getSleuthkitCase()
final BlackboardArtifact.ARTIFACT_TYPE artifactType
AbstractFile getAbstractFileById(long id)
String getDisplayString()
BlackboardArtifact.ARTIFACT_TYPE getArtifactType()
List<?extends EventType > getSubTypes()
final BiFunction< BlackboardArtifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute >, String > longExtractor
final BiFunction< BlackboardArtifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute >, String > medExtractor
EventType getSubType(String string)
BiFunction< BlackboardArtifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute >, String > getMedExtractor()
static String stringValueOf(BlackboardAttribute attr)
BiFunction< BlackboardArtifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute >, String > getFullExtractor()