19 package org.sleuthkit.autopsy.geolocation.datamodel;
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.HashMap;
24 import java.util.HashSet;
25 import java.util.List;
44 final private AbstractFile
image;
57 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME,
58 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE,
59 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LATITUDE,
60 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_ALTITUDE,
61 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME,
62 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED,
63 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LATITUDE_START,
64 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE_START,
65 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LATITUDE_END,
66 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE_END,};
83 Waypoint(BlackboardArtifact artifact, String label, Long timestamp, Double latitude, Double longitude, Double altitude, AbstractFile image, Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> attributeMap,
Route route)
throws GeoLocationDataException {
84 if (longitude == null || latitude == null) {
195 private static String
getLabelFromArtifact(Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> attributeMap) {
196 BlackboardAttribute attribute = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME);
197 if (attribute != null) {
198 return attribute.getDisplayString();
215 static Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> getAttributesFromArtifactAsMap(BlackboardArtifact artifact)
throws GeoLocationDataException {
216 Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> attributeMap =
new HashMap<>();
218 List<BlackboardAttribute> attributeList = artifact.getAttributes();
219 for (BlackboardAttribute attribute : attributeList) {
220 BlackboardAttribute.ATTRIBUTE_TYPE type = BlackboardAttribute.ATTRIBUTE_TYPE.fromID(attribute.getAttributeType().getTypeID());
221 attributeMap.put(type, attribute);
223 }
catch (TskCoreException ex) {
224 throw new GeoLocationDataException(
"Unable to get attributes from artifact", ex);
244 Set<BlackboardAttribute.ATTRIBUTE_TYPE> keys =
new HashSet<>(attributeMap.keySet());
250 for (BlackboardAttribute.ATTRIBUTE_TYPE type : keys) {
252 String value = attributeMap.get(type).getDisplayString();
275 private Property(String displayName, String value) {
List< Waypoint.Property > getOtherProperties()
static String getLabelFromArtifact(Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute > attributeMap)
static final BlackboardAttribute.ATTRIBUTE_TYPE[] ALREADY_HANDLED_ATTRIBUTES
final BlackboardArtifact artifact
static List< Waypoint.Property > createGeolocationProperties(Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute > attributeMap)
final List< Waypoint.Property > immutablePropertiesList
BlackboardArtifact getArtifact()
Property(String displayName, String value)