Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sleuthkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRT
Sleuthkit
Commits
fc8a10ea
Unverified
Commit
fc8a10ea
authored
5 years ago
by
Richard Cordovano
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1943 from gdicristofaro/6355-geolocationNPE
6355 geolocation npe
parents
2879a039
3e9c20f1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bindings/java/src/org/sleuthkit/datamodel/blackboardutils/GeoArtifactsHelper.java
+26
-17
26 additions, 17 deletions
...euthkit/datamodel/blackboardutils/GeoArtifactsHelper.java
with
26 additions
and
17 deletions
bindings/java/src/org/sleuthkit/datamodel/blackboardutils/GeoArtifactsHelper.java
+
26
−
17
View file @
fc8a10ea
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
public
final
class
GeoArtifactsHelper
extends
ArtifactHelperBase
{
public
final
class
GeoArtifactsHelper
extends
ArtifactHelperBase
{
private
static
final
BlackboardAttribute
.
Type
WAYPOINTS_ATTR_TYPE
=
new
BlackboardAttribute
.
Type
(
BlackboardAttribute
.
ATTRIBUTE_TYPE
.
TSK_GEO_WAYPOINTS
);
private
static
final
BlackboardAttribute
.
Type
WAYPOINTS_ATTR_TYPE
=
new
BlackboardAttribute
.
Type
(
BlackboardAttribute
.
ATTRIBUTE_TYPE
.
TSK_GEO_WAYPOINTS
);
private
static
final
BlackboardAttribute
.
Type
TRACKPOINTS_ATTR_TYPE
=
new
BlackboardAttribute
.
Type
(
BlackboardAttribute
.
ATTRIBUTE_TYPE
.
TSK_GEO_TRACKPOINTS
);
private
static
final
BlackboardAttribute
.
Type
TRACKPOINTS_ATTR_TYPE
=
new
BlackboardAttribute
.
Type
(
BlackboardAttribute
.
ATTRIBUTE_TYPE
.
TSK_GEO_TRACKPOINTS
);
private
final
String
programName
;
private
final
String
programName
;
/**
/**
...
@@ -67,28 +67,32 @@ public GeoArtifactsHelper(SleuthkitCase caseDb, String moduleName, String progra
...
@@ -67,28 +67,32 @@ public GeoArtifactsHelper(SleuthkitCase caseDb, String moduleName, String progra
* (elevation) axes.
* (elevation) axes.
*
*
* @param trackName The name of the GPS track, may be null.
* @param trackName The name of the GPS track, may be null.
* @param trackPoints The track points that make up the track.
* @param trackPoints The track points that make up the track. This list
* should be non-null and non-empty.
* @param moreAttributes Additional attributes for the TSK_GPS_TRACK
* @param moreAttributes Additional attributes for the TSK_GPS_TRACK
* artifact, may be null.
* artifact, may be null.
*
*
* @return The TSK_GPS_TRACK artifact that was added to the case database.
* @return The TSK_GPS_TRACK artifact that was added to the case database.
*
*
* @throws TskCoreException If there is an error creating the artifact.
* @throws TskCoreException If there is an error creating the
* @throws BlackboardException If there is a error posting the artifact to
* artifact.
* the blackboard.
* @throws BlackboardException If there is a error posting the artifact
* to the blackboard.
* @throws IllegalArgumentException If the trackpoints provided are null or
* empty.
*/
*/
public
BlackboardArtifact
addTrack
(
String
trackName
,
GeoTrackPoints
trackPoints
,
List
<
BlackboardAttribute
>
moreAttributes
)
throws
TskCoreException
,
BlackboardException
{
public
BlackboardArtifact
addTrack
(
String
trackName
,
GeoTrackPoints
trackPoints
,
List
<
BlackboardAttribute
>
moreAttributes
)
throws
TskCoreException
,
BlackboardException
{
if
(
trackPoints
==
null
)
{
if
(
trackPoints
==
null
||
trackPoints
.
isEmpty
()
)
{
throw
new
IllegalArgumentException
(
String
.
format
(
"addTrack was passed a null list of track points"
));
throw
new
IllegalArgumentException
(
String
.
format
(
"addTrack was passed a null
or empty
list of track points"
));
}
}
BlackboardArtifact
artifact
=
getContent
().
newArtifact
(
BlackboardArtifact
.
ARTIFACT_TYPE
.
TSK_GPS_TRACK
);
List
<
BlackboardAttribute
>
attributes
=
new
ArrayList
<>();
List
<
BlackboardAttribute
>
attributes
=
new
ArrayList
<>();
if
(
trackName
!=
null
)
{
if
(
trackName
!=
null
)
{
attributes
.
add
(
new
BlackboardAttribute
(
BlackboardAttribute
.
ATTRIBUTE_TYPE
.
TSK_NAME
,
getModuleName
(),
trackName
));
attributes
.
add
(
new
BlackboardAttribute
(
BlackboardAttribute
.
ATTRIBUTE_TYPE
.
TSK_NAME
,
getModuleName
(),
trackName
));
}
}
// acquire necessary attribute. If 'toAttribute' call throws an exception, an artifact will not be created for this instance.
attributes
.
add
(
BlackboardJsonAttrUtil
.
toAttribute
(
TRACKPOINTS_ATTR_TYPE
,
getModuleName
(),
trackPoints
));
attributes
.
add
(
BlackboardJsonAttrUtil
.
toAttribute
(
TRACKPOINTS_ATTR_TYPE
,
getModuleName
(),
trackPoints
));
if
(
programName
!=
null
)
{
if
(
programName
!=
null
)
{
...
@@ -99,13 +103,14 @@ public BlackboardArtifact addTrack(String trackName, GeoTrackPoints trackPoints,
...
@@ -99,13 +103,14 @@ public BlackboardArtifact addTrack(String trackName, GeoTrackPoints trackPoints,
attributes
.
addAll
(
moreAttributes
);
attributes
.
addAll
(
moreAttributes
);
}
}
BlackboardArtifact
artifact
=
getContent
().
newArtifact
(
BlackboardArtifact
.
ARTIFACT_TYPE
.
TSK_GPS_TRACK
);
artifact
.
addAttributes
(
attributes
);
artifact
.
addAttributes
(
attributes
);
getSleuthkitCase
().
getBlackboard
().
postArtifact
(
artifact
,
getModuleName
());
getSleuthkitCase
().
getBlackboard
().
postArtifact
(
artifact
,
getModuleName
());
return
artifact
;
return
artifact
;
}
}
/**
/**
* Adds a TSK_GPS_ROUTE artifact to the case database. A Global Positioning
* Adds a TSK_GPS_ROUTE artifact to the case database. A Global Positioning
* System (GPS) route artifact records one or more waypoints entered into a
* System (GPS) route artifact records one or more waypoints entered into a
...
@@ -117,19 +122,23 @@ public BlackboardArtifact addTrack(String trackName, GeoTrackPoints trackPoints,
...
@@ -117,19 +122,23 @@ public BlackboardArtifact addTrack(String trackName, GeoTrackPoints trackPoints,
* @param creationTime The time at which the route was created as
* @param creationTime The time at which the route was created as
* milliseconds from the Java epoch of
* milliseconds from the Java epoch of
* 1970-01-01T00:00:00Z, may be null.
* 1970-01-01T00:00:00Z, may be null.
* @param wayPoints The waypoints that make up the route.
* @param wayPoints The waypoints that make up the route. This list
* should be non-null and non-empty.
* @param moreAttributes Additional attributes for the TSK_GPS_ROUTE
* @param moreAttributes Additional attributes for the TSK_GPS_ROUTE
* artifact, may be null.
* artifact, may be null.
*
*
* @return The TSK_GPS_ROUTE artifact that was added to the case database.
* @return The TSK_GPS_ROUTE artifact that was added to the case database.
*
*
* @throws TskCoreException If there is an error creating the artifact.
* @throws TskCoreException If there is an error creating the
* @throws BlackboardException If there is a error posting the artifact to
* artifact.
* the blackboard.
* @throws BlackboardException If there is a error posting the artifact
* to the blackboard.
* @throws IllegalArgumentException If the waypoints provided are null or
* empty.
*/
*/
public
BlackboardArtifact
addRoute
(
String
routeName
,
Long
creationTime
,
GeoWaypoints
wayPoints
,
List
<
BlackboardAttribute
>
moreAttributes
)
throws
TskCoreException
,
BlackboardException
{
public
BlackboardArtifact
addRoute
(
String
routeName
,
Long
creationTime
,
GeoWaypoints
wayPoints
,
List
<
BlackboardAttribute
>
moreAttributes
)
throws
TskCoreException
,
BlackboardException
{
if
(
wayPoints
==
null
)
{
if
(
wayPoints
==
null
||
wayPoints
.
isEmpty
()
)
{
throw
new
IllegalArgumentException
(
String
.
format
(
"addRoute was passed a null list of waypoints"
));
throw
new
IllegalArgumentException
(
String
.
format
(
"addRoute was passed a null
or empty
list of waypoints"
));
}
}
BlackboardArtifact
artifact
=
getContent
().
newArtifact
(
BlackboardArtifact
.
ARTIFACT_TYPE
.
TSK_GPS_ROUTE
);
BlackboardArtifact
artifact
=
getContent
().
newArtifact
(
BlackboardArtifact
.
ARTIFACT_TYPE
.
TSK_GPS_ROUTE
);
...
@@ -159,5 +168,5 @@ public BlackboardArtifact addRoute(String routeName, Long creationTime, GeoWaypo
...
@@ -159,5 +168,5 @@ public BlackboardArtifact addRoute(String routeName, Long creationTime, GeoWaypo
return
artifact
;
return
artifact
;
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment