Sleuth Kit Java Bindings (JNI)  4.6
Java bindings for using The Sleuth Kit
GeoArtifactsHelper.java
Go to the documentation of this file.
1 /*
2  * Sleuth Kit Data Model
3  *
4  * Copyright 2020 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.datamodel.blackboardutils;
20 
21 import java.util.ArrayList;
22 import java.util.Collection;
23 import java.util.Collections;
30 
35 public final class GeoArtifactsHelper extends ArtifactHelperBase {
36 
44  public GeoArtifactsHelper(SleuthkitCase caseDb, String moduleName, Content srcFile) {
45  super(caseDb, moduleName, srcFile);
46  }
47 
64  public BlackboardArtifact addGPSTrackpoint(double latitude, double longitude,
65  long timeStamp, String name, String programName) throws TskCoreException, BlackboardException {
66 
67  return addGPSTrackpoint(latitude, longitude, timeStamp, name, programName,
68  Collections.emptyList());
69  }
70 
90  public BlackboardArtifact addGPSTrackpoint(double latitude, double longitude, long timeStamp, String name, String programName,
91  Collection<BlackboardAttribute> otherAttributesList) throws TskCoreException, BlackboardException {
92 
93  BlackboardArtifact gpsTrackpointArtifact;
94  Collection<BlackboardAttribute> attributes = new ArrayList<>();
95 
96  // create artifact
97  gpsTrackpointArtifact = getContent().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_TRACKPOINT);
98 
99  // construct attributes
100  attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LATITUDE, getModuleName(), latitude));
101  attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE, getModuleName(), longitude));
102 
103  addAttributeIfNotZero(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME, timeStamp, attributes);
104 
105  addAttributeIfNotNull(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME, name, attributes);
106  addAttributeIfNotNull(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME, programName, attributes);
107 
108  // add the attributes
109  attributes.addAll(otherAttributesList);
110  gpsTrackpointArtifact.addAttributes(attributes);
111 
112  // post artifact
113  getSleuthkitCase().getBlackboard().postArtifact(gpsTrackpointArtifact, getModuleName());
114 
115  // return the artifact
116  return gpsTrackpointArtifact;
117  }
118 
119 }
BlackboardArtifact addGPSTrackpoint(double latitude, double longitude, long timeStamp, String name, String programName, Collection< BlackboardAttribute > otherAttributesList)
BlackboardArtifact newArtifact(int artifactTypeID)
GeoArtifactsHelper(SleuthkitCase caseDb, String moduleName, Content srcFile)
BlackboardArtifact addGPSTrackpoint(double latitude, double longitude, long timeStamp, String name, String programName)

Copyright © 2011-2018 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.