diff --git a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java index aec0d9042f..afdd78c2ae 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java @@ -40,31 +40,13 @@ final class DataSourceIngestPipeline { this.context = context; // Create an ingest module instance from each data source ingest module - // template. Put the modules in a map of module class names to module - // instances to facilitate loading the modules into the pipeline in the - // sequence indicated by the ordered list of module class names that - // will be obtained from the data source ingest pipeline configuration. - Map modulesByClass = new HashMap<>(); + // template. for (IngestModuleTemplate template : moduleTemplates) { if (template.isDataSourceIngestModuleTemplate()) { DataSourceIngestModuleDecorator module = new DataSourceIngestModuleDecorator(template.createDataSourceIngestModule(), template.getModuleName()); - modulesByClass.put(module.getClassName(), module); + modules.add(module); } } - - // Add the ingest modules to the pipeline in the order indicated by the - // data source ingest pipeline configuration, adding any additional - // modules found in the global lookup, but not mentioned in the - // configuration, to the end of the pipeline in arbitrary order. - List pipelineConfig = IngestPipelinesConfiguration.getInstance().getDataSourceIngestPipelineConfig(); - for (String moduleClassName : pipelineConfig) { - if (modulesByClass.containsKey(moduleClassName)) { - modules.add(modulesByClass.remove(moduleClassName)); - } - } - for (DataSourceIngestModuleDecorator module : modulesByClass.values()) { - modules.add(module); - } } boolean isEmpty() { diff --git a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java index 02dd61b7c7..2394940f61 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java @@ -37,34 +37,12 @@ final class FileIngestPipeline { // Create an ingest module instance from each file ingest module // template. - // current code uses the order pased in. - // Commented out code relied on the XML configuration file for ordering. - //Map modulesByClass = new HashMap<>(); for (IngestModuleTemplate template : moduleTemplates) { if (template.isFileIngestModuleTemplate()) { FileIngestModuleDecorator module = new FileIngestModuleDecorator(template.createFileIngestModule(), template.getModuleName()); modules.add(module); - //modulesByClass.put(module.getClassName(), module); } } - - // Add the ingest modules to the pipeline in the order indicated by the - // data source ingest pipeline configuration, adding any additional - // modules found in the global lookup, but not mentioned in the - // configuration, to the end of the pipeline in arbitrary order. - /*List pipelineConfig = IngestPipelinesConfiguration.getInstance().getFileIngestPipelineConfig(); - for (String moduleClassName : pipelineConfig) { - if (modulesByClass.containsKey(moduleClassName)) { - modules.add(modulesByClass.remove(moduleClassName)); - } - else { - // @@@ add error message to flag renamed / removed modules - } - } - for (FileIngestModuleDecorator module : modulesByClass.values()) { - modules.add(module); - } - */ } boolean isEmpty() { diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryLoader.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryLoader.java index 3ae631dd87..e7ce367a64 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryLoader.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryLoader.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.TreeMap; import java.util.logging.Level; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; @@ -41,7 +42,7 @@ import org.sleuthkit.autopsy.modules.sevenzip.ArchiveFileExtractorModuleFactory; import org.sleuthkit.autopsy.python.JythonModuleLoader; /** - * Discovers ingest module factories implemented in Java or Jython. + * Discovers and instantiates ingest module factories. */ final class IngestModuleFactoryLoader { @@ -111,9 +112,13 @@ final class IngestModuleFactoryLoader { } } - // Add any remaining non-core factories discovered. Order is not - // guaranteed! - factories.addAll(javaFactoriesByClass.values()); + // Add any remaining non-core factories discovered. Order with an + // alphabetical sort by module display name. + TreeMap javaFactoriesSortedByName = new TreeMap<>(); + for (IngestModuleFactory factory : javaFactoriesByClass.values()) { + javaFactoriesSortedByName.put(factory.getModuleDisplayName(), factory); + } + factories.addAll(javaFactoriesSortedByName.values()); // Add any ingest module factories implemented using Jython. Order is // not guaranteed!