Skip to content
Snippets Groups Projects
Unverified Commit 95a74d53 authored by Brian Carrier's avatar Brian Carrier Committed by GitHub
Browse files

Merge pull request #2652 from markmckinnon/8264-validator-finding-changes

Changes based on validator findings
parents adabfb2c dd585e10
No related branches found
No related tags found
No related merge requests found
......@@ -992,7 +992,7 @@ private void assembleMetadataExif(String uuid, BlackboardArtifact artifact, List
.addFacet(new DeviceFacet()
.setManufacturer(getValueIfPresent(artifact, StandardAttributeTypes.TSK_DEVICE_MAKE))
.setModel(getValueIfPresent(artifact, StandardAttributeTypes.TSK_DEVICE_MODEL)))
.addFacet(new LatLongCoordinatesFacets()
.addFacet(new LatLongCoordinatesFacet()
.setAltitude(getDoubleIfPresent(artifact, StandardAttributeTypes.TSK_GEO_ALTITUDE))
.setLatitude(getDoubleIfPresent(artifact, StandardAttributeTypes.TSK_GEO_LATITUDE))
.setLongitude(getDoubleIfPresent(artifact, StandardAttributeTypes.TSK_GEO_LONGITUDE)));
......@@ -1075,17 +1075,19 @@ private void assembleBluetoothPairing(String uuid, BlackboardArtifact artifact,
private void assembleGpsBookmark(String uuid, BlackboardArtifact artifact, List<JsonElement> output) throws TskCoreException {
ObservableObject export = new ObservableObject(uuid)
.addFacet(new LatLongCoordinatesFacets()
.addFacet(new LatLongCoordinatesFacet()
.setAltitude(getDoubleIfPresent(artifact, StandardAttributeTypes.TSK_GEO_ALTITUDE))
.setLatitude(getDoubleIfPresent(artifact, StandardAttributeTypes.TSK_GEO_LATITUDE))
.setLongitude(getDoubleIfPresent(artifact, StandardAttributeTypes.TSK_GEO_LONGITUDE)))
.addFacet(new ApplicationFacet()
.setApplicationIdentifier(getValueIfPresent(artifact, StandardAttributeTypes.TSK_PROG_NAME)));
SimpleAddressFacet simpleAddress = new SimpleAddressFacet();
simpleAddress.setDescription(getValueIfPresent(artifact, StandardAttributeTypes.TSK_LOCATION));
export.addFacet(simpleAddress);
if (getValueIfPresent(artifact, StandardAttributeTypes.TSK_LOCATION) != null) {
simpleAddress.setDescription(getValueIfPresent(artifact, StandardAttributeTypes.TSK_LOCATION));
export.addFacet(simpleAddress);
}
export.setCreatedTime(getLongIfPresent(artifact, StandardAttributeTypes.TSK_DATETIME));
export.setName(getValueIfPresent(artifact, StandardAttributeTypes.TSK_NAME));
......@@ -1094,7 +1096,7 @@ private void assembleGpsBookmark(String uuid, BlackboardArtifact artifact, List<
private void assembleGpsLastKnownLocation(String uuid, BlackboardArtifact artifact, List<JsonElement> output) throws TskCoreException {
ObservableObject export = new ObservableObject(uuid)
.addFacet(new LatLongCoordinatesFacets()
.addFacet(new LatLongCoordinatesFacet()
.setAltitude(getDoubleIfPresent(artifact, StandardAttributeTypes.TSK_GEO_ALTITUDE))
.setLatitude(getDoubleIfPresent(artifact, StandardAttributeTypes.TSK_GEO_LATITUDE))
.setLongitude(getDoubleIfPresent(artifact, StandardAttributeTypes.TSK_GEO_LONGITUDE)));
......@@ -1105,9 +1107,11 @@ private void assembleGpsLastKnownLocation(String uuid, BlackboardArtifact artifa
locationNode.setName(getValueIfPresent(artifact, StandardAttributeTypes.TSK_NAME));
SimpleAddressFacet simpleAddress = new SimpleAddressFacet();
simpleAddress.setDescription(getValueIfPresent(artifact, StandardAttributeTypes.TSK_LOCATION));
export.addFacet(simpleAddress);
if (getValueIfPresent(artifact, StandardAttributeTypes.TSK_LOCATION) != null) {
simpleAddress.setDescription(getValueIfPresent(artifact, StandardAttributeTypes.TSK_LOCATION));
export.addFacet(simpleAddress);
}
serializeObjectToOutput(export, output);
serializeObjectToOutput(locationNode, output);
serializeObjectToOutput(new BlankRelationshipNode()
......@@ -1117,7 +1121,7 @@ private void assembleGpsLastKnownLocation(String uuid, BlackboardArtifact artifa
private void assembleGpsSearch(String uuid, BlackboardArtifact artifact, List<JsonElement> output) throws TskCoreException {
ObservableObject export = new ObservableObject(uuid)
.addFacet(new LatLongCoordinatesFacets()
.addFacet(new LatLongCoordinatesFacet()
.setAltitude(getDoubleIfPresent(artifact, StandardAttributeTypes.TSK_GEO_ALTITUDE))
.setLatitude(getDoubleIfPresent(artifact, StandardAttributeTypes.TSK_GEO_LATITUDE))
.setLongitude(getDoubleIfPresent(artifact, StandardAttributeTypes.TSK_GEO_LONGITUDE)));
......@@ -1128,8 +1132,11 @@ private void assembleGpsSearch(String uuid, BlackboardArtifact artifact, List<Js
locationNode.setName(getValueIfPresent(artifact, StandardAttributeTypes.TSK_NAME));
SimpleAddressFacet simpleAddress = new SimpleAddressFacet();
simpleAddress.setDescription(getValueIfPresent(artifact, StandardAttributeTypes.TSK_LOCATION));
export.addFacet(simpleAddress);
if (getValueIfPresent(artifact, StandardAttributeTypes.TSK_LOCATION) != null) {
simpleAddress.setDescription(getValueIfPresent(artifact, StandardAttributeTypes.TSK_LOCATION));
export.addFacet(simpleAddress);
}
serializeObjectToOutput(export, output);
serializeObjectToOutput(locationNode, output);
......@@ -1190,8 +1197,10 @@ private void assembleGPSRoute(String uuid, BlackboardArtifact artifact, List<Jso
export.setCreatedTime(getLongIfPresent(artifact, StandardAttributeTypes.TSK_DATETIME));
SimpleAddressFacet simpleAddress = new SimpleAddressFacet();
simpleAddress.setDescription(getValueIfPresent(artifact, StandardAttributeTypes.TSK_LOCATION));
export.addFacet(simpleAddress);
if (getValueIfPresent(artifact, StandardAttributeTypes.TSK_LOCATION) != null) {
simpleAddress.setDescription(getValueIfPresent(artifact, StandardAttributeTypes.TSK_LOCATION));
export.addFacet(simpleAddress);
}
Location location = new BlankLocationNode();
location.setName(getValueIfPresent(artifact, StandardAttributeTypes.TSK_NAME));
......@@ -1468,7 +1477,7 @@ private void assembleGpsTrack(String uuid, BlackboardArtifact artifact, List<Jso
if (trackpoints != null) {
GeoTrackPoints points = BlackboardJsonAttrUtil.fromAttribute(trackpoints, GeoTrackPoints.class);
for (GeoTrackPoints.TrackPoint point : points) {
export.addFacet(new LatLongCoordinatesFacets()
export.addFacet(new LatLongCoordinatesFacet()
.setAltitude(point.getAltitude())
.setLatitude(point.getLatitude())
.setLongitude(point.getLongitude()));
......
......@@ -21,10 +21,10 @@
import com.google.gson.annotations.SerializedName;
/**
* This class definition mirrors the LatLongCoordinatesFacets observable described in
* This class definition mirrors the LatLongCoordinatesFacet observable described in
the UCO ontology.
*/
class LatLongCoordinatesFacets extends Facet {
class LatLongCoordinatesFacet extends Facet {
@SerializedName("location:altitude")
private Double altitude;
......@@ -35,21 +35,21 @@ class LatLongCoordinatesFacets extends Facet {
@SerializedName("location:longitude")
private Double longitude;
LatLongCoordinatesFacets() {
super(UcoObject.UCO_LOCATION + LatLongCoordinatesFacets.class.getSimpleName());
LatLongCoordinatesFacet() {
super(UcoObject.UCO_LOCATION + LatLongCoordinatesFacet.class.getSimpleName());
}
LatLongCoordinatesFacets setAltitude(Double altitude) {
LatLongCoordinatesFacet setAltitude(Double altitude) {
this.altitude = altitude;
return this;
}
LatLongCoordinatesFacets setLatitude(Double latitude) {
LatLongCoordinatesFacet setLatitude(Double latitude) {
this.latitude = latitude;
return this;
}
LatLongCoordinatesFacets setLongitude(Double longitude) {
LatLongCoordinatesFacet setLongitude(Double longitude) {
this.longitude = longitude;
return this;
}
......
......@@ -29,7 +29,7 @@ class ObservableObject extends UcoObject {
static final String OBSERVABLE = "observable:";
@SerializedName("uco-core:hasFacet")
@SerializedName("core:hasFacet")
private final List<Facet> facets;
ObservableObject(String uuid) {
......
......@@ -27,9 +27,9 @@
*/
abstract class UcoObject {
static final String UCO_OBSERV = "uco-observable:";
static final String UCO_OBSERV = "observable:";
static final String UCO_ACTION = "action:";
static final String UCO_LOCATION = "Location:";
static final String UCO_LOCATION = "location:";
static final String UCO_CORE = "core:";
static final String UCO_IDENTITY = "identity:";
static final String UCO_TYPES = "types:";
......@@ -37,9 +37,6 @@ abstract class UcoObject {
@SerializedName("@id")
private String id;
@SerializedName("@type")
private final String type;
@SerializedName("core:createdTime")
private String createdTime;
......@@ -55,6 +52,9 @@ abstract class UcoObject {
@SerializedName("core:tag")
private String tag;
@SerializedName("@type")
private final String type;
UcoObject(String id, String type) {
this.id = id;
this.type = type;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment