diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypes.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypes.java index 563f9c8cee3ba44dc3f11a6db7092423d4587da1..aa1d0a04ec7aed6775173798f7f9e75f621b7826 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypes.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypes.java @@ -20,7 +20,6 @@ import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.List; import java.util.Observable; import java.util.Observer; @@ -35,8 +34,6 @@ import org.openide.util.NbBundle; import org.openide.util.lookup.Lookups; import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.datamodel.AnalysisResult; -import org.sleuthkit.datamodel.AnalysisResultAdded; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.Content; @@ -46,7 +43,6 @@ import org.sleuthkit.datamodel.File; import org.sleuthkit.datamodel.LayoutFile; import org.sleuthkit.datamodel.LocalFile; -import org.sleuthkit.datamodel.Score; import org.sleuthkit.datamodel.SlackFile; import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.SleuthkitItemVisitor; @@ -389,11 +385,6 @@ public BlackboardArtifact newArtifact(int artifactTypeID) throws TskCoreExceptio return content.newArtifact(artifactTypeID); } - @Override - public AnalysisResultAdded newAnalysisResult(BlackboardArtifact.Type artifactType, Score score, String conclusion, String configuration, String justification, Collection<BlackboardAttribute> attributesList) throws TskCoreException { - return content.newAnalysisResult(artifactType, score, conclusion, configuration, justification, attributesList); - } - @Override public BlackboardArtifact newArtifact(BlackboardArtifact.ARTIFACT_TYPE type) throws TskCoreException { return content.newArtifact(type); @@ -434,15 +425,6 @@ public ArrayList<BlackboardArtifact> getAllArtifacts() throws TskCoreException { return content.getAllArtifacts(); } - @Override - public List<AnalysisResult> getAllAnalysisResults() throws TskCoreException { - return content.getAllAnalysisResults(); - } - - public List<AnalysisResult> getAnalysisResults(BlackboardArtifact.Type artifactType) throws TskCoreException { - return content.getAnalysisResults(artifactType); - } - @Override public Set<String> getHashSetNames() throws TskCoreException { return content.getHashSetNames(); @@ -467,10 +449,5 @@ public long getArtifactsCount(BlackboardArtifact.ARTIFACT_TYPE type) throws TskC public long getAllArtifactsCount() throws TskCoreException { return content.getAllArtifactsCount(); } - - @Override - public Score getAggregateScore() throws TskCoreException { - return content.getAggregateScore(); - } } } diff --git a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java index 74e019d8cb15c3721f3725ba4b963ff82938cb7a..19b9ff28b7b0ff9b493a8b227b0ebea6cda912c9 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java @@ -41,8 +41,6 @@ import org.sleuthkit.autopsy.ingest.IngestServices; import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb; import org.sleuthkit.datamodel.AbstractFile; -import org.sleuthkit.datamodel.AnalysisResult; -import org.sleuthkit.datamodel.AnalysisResultAdded; import org.sleuthkit.datamodel.Blackboard; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE; @@ -50,7 +48,6 @@ import org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE; import org.sleuthkit.datamodel.HashHitInfo; import org.sleuthkit.datamodel.HashUtility; -import org.sleuthkit.datamodel.Score; import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskData; @@ -519,7 +516,7 @@ private void calculateHashes(AbstractFile file, IngestJobTotals totals) throws T private void postHashSetHitToBlackboard(AbstractFile abstractFile, String md5Hash, String hashSetName, String comment, boolean showInboxMessage) { try { String moduleName = HashLookupModuleFactory.getModuleName(); - //BlackboardArtifact badFile = abstractFile.newArtifact(ARTIFACT_TYPE.TSK_HASHSET_HIT); + BlackboardArtifact badFile = abstractFile.newArtifact(ARTIFACT_TYPE.TSK_HASHSET_HIT); Collection<BlackboardAttribute> attributes = new ArrayList<>(); //TODO Revisit usage of deprecated constructor as per TSK-583 //BlackboardAttribute att2 = new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID(), MODULE_NAME, "Known Bad", hashSetName); @@ -527,22 +524,14 @@ private void postHashSetHitToBlackboard(AbstractFile abstractFile, String md5Has attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_HASH_MD5, moduleName, md5Hash)); attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_COMMENT, moduleName, comment)); - SleuthkitCase.CaseDbTransaction trans = this.skCase.beginTransaction(); - - AnalysisResultAdded resultAdded = blackboard.newAnalysisResult(new BlackboardArtifact.Type(ARTIFACT_TYPE.TSK_HASHSET_HIT), abstractFile.getId(), abstractFile.getDataSourceObjectId(), new Score(Score.Significance.MEDIUM, Score.Confidence.HIGH), moduleName, comment, hashSetName, attributes, trans); - AnalysisResult badFile = resultAdded.getAnalysisResult(); - trans.commit(); + badFile.addAttributes(attributes); try { /* * post the artifact which will index the artifact for keyword * search, and fire an event to notify UI of this new artifact */ - - - blackboard.postArtifact(badFile, moduleName); - } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + badFile.getArtifactID(), ex); //NON-NLS MessageNotifyUtil.Notify.error( @@ -585,7 +574,7 @@ private void postHashSetHitToBlackboard(AbstractFile abstractFile, String md5Has abstractFile.getName() + md5Hash, badFile)); } - } catch (TskException | Blackboard.BlackboardException ex) { + } catch (TskException ex) { logger.log(Level.WARNING, "Error creating blackboard artifact", ex); //NON-NLS } }