mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Implement a short-term alphabetical sort of non-core Java ingest modules
This commit is contained in:
parent
2feccdd361
commit
edf91c0630
@ -40,31 +40,13 @@ final class DataSourceIngestPipeline {
|
|||||||
this.context = context;
|
this.context = context;
|
||||||
|
|
||||||
// Create an ingest module instance from each data source ingest module
|
// Create an ingest module instance from each data source ingest module
|
||||||
// template. Put the modules in a map of module class names to module
|
// template.
|
||||||
// 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<String, DataSourceIngestModuleDecorator> modulesByClass = new HashMap<>();
|
|
||||||
for (IngestModuleTemplate template : moduleTemplates) {
|
for (IngestModuleTemplate template : moduleTemplates) {
|
||||||
if (template.isDataSourceIngestModuleTemplate()) {
|
if (template.isDataSourceIngestModuleTemplate()) {
|
||||||
DataSourceIngestModuleDecorator module = new DataSourceIngestModuleDecorator(template.createDataSourceIngestModule(), template.getModuleName());
|
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<String> 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() {
|
boolean isEmpty() {
|
||||||
|
@ -37,34 +37,12 @@ final class FileIngestPipeline {
|
|||||||
|
|
||||||
// Create an ingest module instance from each file ingest module
|
// Create an ingest module instance from each file ingest module
|
||||||
// template.
|
// template.
|
||||||
// current code uses the order pased in.
|
|
||||||
// Commented out code relied on the XML configuration file for ordering.
|
|
||||||
//Map<String, FileIngestModuleDecorator> modulesByClass = new HashMap<>();
|
|
||||||
for (IngestModuleTemplate template : moduleTemplates) {
|
for (IngestModuleTemplate template : moduleTemplates) {
|
||||||
if (template.isFileIngestModuleTemplate()) {
|
if (template.isFileIngestModuleTemplate()) {
|
||||||
FileIngestModuleDecorator module = new FileIngestModuleDecorator(template.createFileIngestModule(), template.getModuleName());
|
FileIngestModuleDecorator module = new FileIngestModuleDecorator(template.createFileIngestModule(), template.getModuleName());
|
||||||
modules.add(module);
|
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<String> 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() {
|
boolean isEmpty() {
|
||||||
|
@ -22,6 +22,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.TreeMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.openide.DialogDisplayer;
|
import org.openide.DialogDisplayer;
|
||||||
import org.openide.NotifyDescriptor;
|
import org.openide.NotifyDescriptor;
|
||||||
@ -41,7 +42,7 @@ import org.sleuthkit.autopsy.modules.sevenzip.ArchiveFileExtractorModuleFactory;
|
|||||||
import org.sleuthkit.autopsy.python.JythonModuleLoader;
|
import org.sleuthkit.autopsy.python.JythonModuleLoader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Discovers ingest module factories implemented in Java or Jython.
|
* Discovers and instantiates ingest module factories.
|
||||||
*/
|
*/
|
||||||
final class IngestModuleFactoryLoader {
|
final class IngestModuleFactoryLoader {
|
||||||
|
|
||||||
@ -111,9 +112,13 @@ final class IngestModuleFactoryLoader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add any remaining non-core factories discovered. Order is not
|
// Add any remaining non-core factories discovered. Order with an
|
||||||
// guaranteed!
|
// alphabetical sort by module display name.
|
||||||
factories.addAll(javaFactoriesByClass.values());
|
TreeMap<String, IngestModuleFactory> 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
|
// Add any ingest module factories implemented using Jython. Order is
|
||||||
// not guaranteed!
|
// not guaranteed!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user