fix for validating artifact type

This commit is contained in:
Greg DiCristofaro 2021-01-13 14:15:18 -05:00
parent cbd9d96e7b
commit 37b51d0c62

View File

@ -532,10 +532,12 @@ public final class LeappFileProcessor {
String comment = nnm.getNamedItem("comment").getNodeValue(); String comment = nnm.getNamedItem("comment").getNodeValue();
String parentName = artifactNlist.item(k).getParentNode().getAttributes().getNamedItem("filename").getNodeValue(); String parentName = artifactNlist.item(k).getParentNode().getAttributes().getNamedItem("filename").getNodeValue();
BlackboardArtifact.ARTIFACT_TYPE foundArtifactType = Stream.of(BlackboardArtifact.ARTIFACT_TYPE.values()) BlackboardArtifact.ARTIFACT_TYPE foundArtifactType = null;
.filter((art_type) -> art_type.name().equalsIgnoreCase(artifactName)) try {
.findFirst() Case.getCurrentCase().getSleuthkitCase().getArtifactType(artifactName);
.orElse(null); } catch (TskCoreException ex) {
logger.log(Level.SEVERE, String.format("There was an issue that arose while trying to fetch artifact type for %s.", artifactName), ex);
}
if (foundArtifactType == null) { if (foundArtifactType == null) {
logger.log(Level.SEVERE, String.format("No known artifact mapping found for [artifact: %s, %s]", logger.log(Level.SEVERE, String.format("No known artifact mapping found for [artifact: %s, %s]",