Skip to content
Snippets Groups Projects
Unverified Commit 31a79686 authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #1814 from kellykelly3/1406-deprecate-TSK_GPS_TRACKPOINT

1406 - Deprecated TSK_GPS_TRACKPOINT
parents eb23d572 2d755401
No related branches found
No related tags found
No related merge requests found
......@@ -956,7 +956,10 @@ public enum ARTIFACT_TYPE implements SleuthkitVisitableItem {
bundle.getString("BlackboardArtifact.tsk.recentObject.text")),
/**
* A GPS track point (geolocation data).
*
* @deprecated Use TSK_GPS_TRACK instead
*/
@Deprecated
TSK_GPS_TRACKPOINT(7, "TSK_GPS_TRACKPOINT", //NON-NLS
bundle.getString("BlackboardArtifact.tskGpsTrackpoint.text")),
/**
......
......@@ -328,6 +328,7 @@ public int compare(TimelineEventType o1, TimelineEventType o2) {
return String.format("from %1$s %2$s to %3$s %4$s", stringValueOf(latStart), stringValueOf(longStart), stringValueOf(latEnd), stringValueOf(longEnd)); // NON-NLS
});
@SuppressWarnings("deprecation")
TimelineEventType GPS_TRACKPOINT = new TimelineEventArtifactTypeImpl(15,
getBundle().getString("MiscTypes.GPSTrackpoint.name"), // NON-NLS
MISC_TYPES,
......
......@@ -19,9 +19,6 @@
package org.sleuthkit.datamodel.blackboardutils;
import org.sleuthkit.datamodel.blackboardutils.attributes.GeoTrackPoints;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.sleuthkit.datamodel.Blackboard.BlackboardException;
import org.sleuthkit.datamodel.BlackboardArtifact;
......@@ -80,77 +77,4 @@ public BlackboardArtifact addTrack(String trackName, List<GeoTrackPoint> points)
return artifact;
}
/**
* Adds a Track with a single point. A GPS track generally refers to several points that a device has
* traversed and addTrack() is more appropriate.
*
* @param latitude Location latitude, required.
* @param longitude Location longitude, required.
* @param timeStamp Date/time trackpoint was recorded, can be 0 if not
* available.
* @param name Trackpoint name, can be empty/null if not available.
* @param programName Name of program that recorded the trackpoint, can be
* empty or null if not available.
*
* @return GPS trackpoint artifact added
*
* @throws TskCoreException If there is an error creating the artifact.
* @throws BlackboardException If there is a problem posting the artifact.
*/
public BlackboardArtifact addGPSTrackpoint(double latitude, double longitude,
long timeStamp, String name, String programName) throws TskCoreException, BlackboardException {
return addGPSTrackpoint(latitude, longitude, timeStamp, name, programName,
Collections.emptyList());
}
/**
* Adds a TSK_GPS_TRACKPOINT artifact.
*
* @param latitude Location latitude, required.
* @param longitude Location longitude, required.
* @param timeStamp Date/time the trackpoint was recorded, can be
* 0 if not available.
* @param name Trackpoint name, can be empty/null if not
* available.
* @param programName Name of program that recorded the trackpoint,
* can be empty or null if not available.
* @param otherAttributesList Other attributes, can be an empty list of no
* additional attributes.
*
* @return GPS trackpoint artifact added
*
* @throws TskCoreException If there is an error creating the artifact.
* @throws BlackboardException If there is a problem posting the artifact.
*/
public BlackboardArtifact addGPSTrackpoint(double latitude, double longitude, long timeStamp, String name, String programName,
Collection<BlackboardAttribute> otherAttributesList) throws TskCoreException, BlackboardException {
BlackboardArtifact gpsTrackpointArtifact;
Collection<BlackboardAttribute> attributes = new ArrayList<>();
// create artifact
gpsTrackpointArtifact = getContent().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_TRACKPOINT);
// construct attributes
attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LATITUDE, getModuleName(), latitude));
attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE, getModuleName(), longitude));
addAttributeIfNotZero(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME, timeStamp, attributes);
addAttributeIfNotNull(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME, name, attributes);
addAttributeIfNotNull(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME, programName, attributes);
// add the attributes
attributes.addAll(otherAttributesList);
gpsTrackpointArtifact.addAttributes(attributes);
// post artifact
getSleuthkitCase().getBlackboard().postArtifact(gpsTrackpointArtifact, getModuleName());
// return the artifact
return gpsTrackpointArtifact;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment