From b76096f5b4330f68a38b8b436a5c78f491ea77af Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 27 Jan 2016 09:19:49 -0500 Subject: [PATCH] Made sample not visible, fixed creation of file type sig attribute --- .../autopsy/externalresults/ExternalResultsImporter.java | 2 +- .../sleuthkit/autopsy/ingest/IngestModuleFactoryLoader.java | 4 ++-- .../autopsy/modules/filetypeid/FileTypeDetector.java | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsImporter.java b/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsImporter.java index f2cdabb9d1..61360d9fb7 100644 --- a/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsImporter.java +++ b/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsImporter.java @@ -144,7 +144,7 @@ public final class ExternalResultsImporter { // Add the artifact's attributes to the case database. Collection attributes = new ArrayList<>(); for (ExternalResults.ArtifactAttribute attributeData : artifactData.getAttributes()) { - BlackboardAttribute.Type attributeType = caseDb.getAttrType(attributeData.getType()); + BlackboardAttribute.Type attributeType = caseDb.getAttributeType(attributeData.getType()); if (attributeType == null) { switch (attributeData.getValueType()) { case "text": //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryLoader.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryLoader.java index d9c5e93584..59b978bf24 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryLoader.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryLoader.java @@ -143,8 +143,8 @@ final class IngestModuleFactoryLoader { private static void addFactory(IngestModuleFactory factory, HashSet moduleDisplayNames, HashMap javaFactoriesByClass) { // Ignore the sample ingest module factories implemented in Java. String className = factory.getClass().getCanonicalName(); - if (className.equals(IngestModuleFactoryLoader.SAMPLE_MODULE_FACTORY_CLASS_NAME)) { - //|| className.equals(IngestModuleFactoryLoader.SAMPLE_EXECUTABLE_MODULE_FACTORY_CLASS_NAME)) { + if (className.equals(IngestModuleFactoryLoader.SAMPLE_MODULE_FACTORY_CLASS_NAME) + || className.equals(IngestModuleFactoryLoader.SAMPLE_EXECUTABLE_MODULE_FACTORY_CLASS_NAME)) { return; } diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java index f34c84c605..bf1839fa8c 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java @@ -152,11 +152,10 @@ public class FileTypeDetector { * because general info artifacts are different from other * artifacts, e.g., they are not displayed in the results tree. */ - BlackboardArtifact getInfoArt = file.getGenInfoArtifact(); - BlackboardAttribute batt = new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_FILE_TYPE_SIG, FileTypeIdModuleFactory.getModuleName(), mimeType); - getInfoArt.addAttribute(batt); try { file.setMIMEType(mimeType); + BlackboardArtifact getInfoArt = file.getGenInfoArtifact(); + BlackboardAttribute batt = new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_FILE_TYPE_SIG, FileTypeIdModuleFactory.getModuleName(), mimeType); getInfoArt.addAttribute(batt); } catch (TskDataException ex) { //Swallowing exception so that the logs aren't clogged in the case that ingest is run multiple times.