Autopsy  4.14.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
GeoPath.java
Go to the documentation of this file.
1 /*
2  *
3  * Autopsy Forensic Browser
4  *
5  * Copyright 2020 Basis Technology Corp.
6  * contact: carrier <at> sleuthkit <dot> org
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 package org.sleuthkit.autopsy.geolocation.datamodel;
21 
22 import java.util.ArrayList;
23 import java.util.Collections;
24 import java.util.List;
25 import org.sleuthkit.datamodel.BlackboardArtifact;
26 import org.sleuthkit.datamodel.Content;
27 import org.sleuthkit.datamodel.SleuthkitCase;
28 import org.sleuthkit.datamodel.TskCoreException;
29 
33 public class GeoPath {
34 
35  private final List<Waypoint> waypointList;
36  private final String pathName;
37  private final BlackboardArtifact artifact;
38 
49  static public List<Route> getRoutes(SleuthkitCase skCase) throws GeoLocationDataException {
50  List<BlackboardArtifact> artifacts = null;
51  try {
52  artifacts = skCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_ROUTE);
53  } catch (TskCoreException ex) {
54  throw new GeoLocationDataException("Unable to get artifacts for type: TSK_GPS_BOOKMARK", ex);
55  }
56 
57  List<Route> routes = new ArrayList<>();
58  for (BlackboardArtifact artifact : artifacts) {
59  Route route = new Route(artifact);
60  routes.add(route);
61  }
62  return routes;
63  }
64 
77  static public List<Track> getTracks(SleuthkitCase skCase, List<? extends Content> sourceList) throws GeoLocationDataException {
78  List<BlackboardArtifact> artifacts = null;
79  List<Track> tracks = new ArrayList<>();
80  try {
81  artifacts = skCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_TRACK);
82  for (BlackboardArtifact artifact : artifacts) {
83  if (sourceList == null || sourceList.contains(artifact.getDataSource())) {
84  Track route = new Track(artifact);
85  tracks.add(route);
86  }
87  }
88  } catch (TskCoreException ex) {
89  throw new GeoLocationDataException("Unable to get artifacts for type: TSK_GPS_BOOKMARK", ex);
90  }
91  return tracks;
92  }
93 
100  GeoPath(BlackboardArtifact artifact, String pathName) {
101  this.waypointList = new ArrayList<>();
102  this.pathName = pathName;
103  this.artifact = artifact;
104  }
105 
111  final void addToPath(Waypoint point) {
112  waypointList.add(point);
113  }
114 
120  final public List<Waypoint> getPath() {
121  return Collections.unmodifiableList(waypointList);
122  }
123 
129  final BlackboardArtifact getArtifact() {
130  return artifact;
131  }
132 
138  public String getLabel() {
139  return pathName != null ? pathName : "";
140  }
141 }
static List< Route > getRoutes(SleuthkitCase skCase)
Definition: GeoPath.java:49
static List< Track > getTracks(SleuthkitCase skCase, List<?extends Content > sourceList)
Definition: GeoPath.java:77

Copyright © 2012-2020 Basis Technology. Generated on: Wed Apr 8 2020
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.