diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java index 469b600ac2..53ba078899 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java @@ -19,7 +19,7 @@ package org.sleuthkit.autopsy.casemodule; -import org.sleuthkit.autopsy.ingest.IngestConfigurator; +import org.sleuthkit.autopsy.ingest.IngestJobLauncher; import java.awt.Component; import java.awt.Dialog; import java.awt.event.ActionEvent; @@ -36,12 +36,12 @@ import org.openide.DialogDisplayer; import org.openide.WizardDescriptor; import org.openide.util.ChangeSupport; import org.openide.util.HelpCtx; -import org.openide.util.Lookup; import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; import org.openide.util.actions.Presenter; import org.openide.util.lookup.ServiceProvider; import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.datamodel.Image; /** @@ -109,8 +109,7 @@ public final class AddImageAction extends CallableSystemAction implements Presen public void actionPerformed(ActionEvent e) { Logger.noteAction(AddImageAction.class); - final IngestConfigurator ingestConfig = Lookup.getDefault().lookup(IngestConfigurator.class); - if (null != ingestConfig && ingestConfig.isIngestRunning()) { + if (IngestManager.getDefault().isIngestRunning()) { final String msg = "Ingest is ongoing on another data source. Adding a new source now might slow down the current ingest.
Do you want to proceed and add a new data source now?"; if (JOptionPane.showConfirmDialog(null, msg, "Ingest in progress", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.NO_OPTION) { return; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigPanel.java index 75948f9117..a979e791c5 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigPanel.java @@ -19,7 +19,7 @@ package org.sleuthkit.autopsy.casemodule; -import org.sleuthkit.autopsy.ingest.IngestConfigurator; +import org.sleuthkit.autopsy.ingest.IngestJobLauncher; import java.awt.Color; import java.awt.Component; import java.awt.Window; @@ -46,7 +46,7 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor; class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel { private static final Logger logger = Logger.getLogger(AddImageWizardIngestConfigPanel.class.getName()); - private IngestConfigurator ingestConfig; + private IngestJobLauncher ingestConfig; /** * The visual component that displays this panel. If you need to access the * component from this class, just use getComponent(). @@ -73,8 +73,8 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel messages = ingestConfig.getMissingIngestModuleErrorMessages(); + ingestConfig = new IngestJobLauncher(AddImageWizardIngestConfigPanel.class.getCanonicalName()); + List messages = ingestConfig.getMissingIngestModuleMessages(); if (messages.isEmpty() == false) { StringBuilder warning = new StringBuilder(); for (String message : messages) { @@ -95,7 +95,7 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.PanelsingletonList(content)); + ingestDialog.setDataSources(Collections.singletonList(content)); ingestDialog.display(); } }); diff --git a/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java b/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java index ef827b763e..af12f04da7 100755 --- a/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java @@ -44,13 +44,14 @@ import org.sleuthkit.datamodel.FsContent; import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.TskCoreException; -// RJCTODO: Remove inheritance from IngestModuleAdapter and provide better documentation. /** * Sample data source ingest module that doesn't do much. Note that the * IngestModuleAdapter abstract class could have been used as a base class to * obtain default implementations of many of the DataSourceIngestModule methods. */ -// RJCTODO: Add service provider annotatin (commend out) +// RJCTODO: Add service provider annotation (commend out) +// RJCTODO: Remove inheritance from IngestModuleAdapter and provide better documentation, +// and more extensive demonstration of how to use various ingest services. class SampleDataSourceIngestModule extends IngestModuleAdapter implements DataSourceIngestModule { private static final Logger logger = Logger.getLogger(SampleDataSourceIngestModule.class); @@ -80,18 +81,4 @@ class SampleDataSourceIngestModule extends IngestModuleAdapter implements DataSo return IngestModule.ResultCode.OK; } -// @Override -// public String getName() { -// return "SampleDataSourceIngestModule"; -// } -// -// @Override -// public String getVersion() { -// return "1.0"; -// } -// -// @Override -// public String getDescription() { -// return "Doesn't do much"; -// } } diff --git a/Core/src/org/sleuthkit/autopsy/examples/SampleFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/examples/SampleFileIngestModule.java index 8466304646..999c207592 100755 --- a/Core/src/org/sleuthkit/autopsy/examples/SampleFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/examples/SampleFileIngestModule.java @@ -1,33 +1,32 @@ /* -* Sample module in the public domain. Feel free to use this as a template -* for your modules. -* -* Contact: Brian Carrier [carrier sleuthkit [dot] org] -* -* This is free and unencumbered software released into the public domain. -* -* Anyone is free to copy, modify, publish, use, compile, sell, or -* distribute this software, either in source code form or as a compiled -* binary, for any purpose, commercial or non-commercial, and by any -* means. -* -* In jurisdictions that recognize copyright laws, the author or authors -* of this software dedicate any and all copyright interest in the -* software to the public domain. We make this dedication for the benefit -* of the public at large and to the detriment of our heirs and -* successors. We intend this dedication to be an overt act of -* relinquishment in perpetuity of all present and future rights to this -* software under copyright law. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -* OTHER DEALINGS IN THE SOFTWARE. -*/ - + * Sample module in the public domain. Feel free to use this as a template + * for your modules. + * + * Contact: Brian Carrier [carrier sleuthkit [dot] org] + * + * This is free and unencumbered software released into the public domain. + * + * Anyone is free to copy, modify, publish, use, compile, sell, or + * distribute this software, either in source code form or as a compiled + * binary, for any purpose, commercial or non-commercial, and by any + * means. + * + * In jurisdictions that recognize copyright laws, the author or authors + * of this software dedicate any and all copyright interest in the + * software to the public domain. We make this dedication for the benefit + * of the public at large and to the detriment of our heirs and + * successors. We intend this dedication to be an overt act of + * relinquishment in perpetuity of all present and future rights to this + * software under copyright law. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ package org.sleuthkit.autopsy.examples; import org.apache.log4j.Logger; @@ -36,7 +35,7 @@ import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.autopsy.ingest.IngestModule; import org.sleuthkit.autopsy.ingest.IngestModuleAdapter; -import org.sleuthkit.autopsy.ingest.IngestModuleContext; +import org.sleuthkit.autopsy.ingest.IngestJobContext; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; @@ -44,23 +43,26 @@ import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.TskData; -// RJCTODO: Remove inheritance from IngestModuleAdapter and provide better documentation. /** - * This is a sample and simple module. It is a file-level ingest module, meaning - * that it will get called on each file in the disk image / logical file set. - * It does a stupid calculation of the number of null bytes in the beginning of the - * file in order to show the basic flow. - * - * Autopsy has been hard coded to ignore this module based on the it's package name. - * IngestModuleLoader will not load things from the org.sleuthkit.autopsy.examples package. - * Either change the package or the loading code to make this module actually run. + * This is a sample and simple module. It is a file-level ingest module, meaning + * that it will get called on each file in the disk image / logical file set. It + * does a stupid calculation of the number of null bytes in the beginning of the + * file in order to show the basic flow. + * + * Autopsy has been hard coded to ignore this module based on the it's package + * name. IngestModuleLoader will not load things from the + * org.sleuthkit.autopsy.examples package. Either change the package or the + * loading code to make this module actually run. */ - // RJCTODO: Add service provider annotatin (commend out) +// RJCTODO: Add service provider annotation (commend out) +// RJCTODO: Remove inheritance from IngestModuleAdapter and provide better documentation, +// and more extensive demonstration of how to use various ingest services. class SampleFileIngestModule extends IngestModuleAdapter implements FileIngestModule { + private int attrId = -1; - + @Override - public void startUp(IngestModuleContext initContext) { + public void startUp(IngestJobContext initContext) { /* For this demo, we are going to make a private attribute to post our * results to the blackbaord with. There are many standard blackboard artifact * and attribute types and you should first consider using one of those before @@ -70,7 +72,7 @@ class SampleFileIngestModule extends IngestModuleAdapter implements FileIngestMo */ Case case1 = Case.getCurrentCase(); SleuthkitCase sleuthkitCase = case1.getSleuthkitCase(); - + // see if the type already exists in the blackboard. try { attrId = sleuthkitCase.getAttrTypeID("ATTR_SAMPLE"); @@ -85,21 +87,21 @@ class SampleFileIngestModule extends IngestModuleAdapter implements FileIngestMo } } } - + @Override public IngestModule.ResultCode process(AbstractFile abstractFile) { // skip non-files - if ((abstractFile.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS) || - (abstractFile.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS)) { + if ((abstractFile.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS) + || (abstractFile.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS)) { return IngestModule.ResultCode.OK; } - + // skip NSRL / known files if (abstractFile.getKnown() == TskData.FileKnown.KNOWN) { return IngestModule.ResultCode.OK; } - - + + /* Do a non-sensical calculation of the number of 0x00 bytes * in the first 1024-bytes of the file. This is for demo * purposes only. @@ -113,7 +115,7 @@ class SampleFileIngestModule extends IngestModuleAdapter implements FileIngestMo count++; } } - + if (attrId != -1) { // Make an attribute using the ID for the private type that we previously created. BlackboardAttribute attr = new BlackboardAttribute(attrId, "SampleFileIngestModule", count); // RJCTODO: Set up with name as exmaple @@ -124,7 +126,7 @@ class SampleFileIngestModule extends IngestModuleAdapter implements FileIngestMo BlackboardArtifact art = abstractFile.getGenInfoArtifact(); art.addAttribute(attr); } - + return IngestModule.ResultCode.OK; } catch (TskCoreException ex) { Exceptions.printStackTrace(ex); @@ -133,20 +135,4 @@ class SampleFileIngestModule extends IngestModuleAdapter implements FileIngestMo } // RJCTODO: Add a module factory - -// @Override -// public String getVersion() { -// return "1.0"; -// } -// -// @Override -// public String getName() { -// return "SampleFileIngestModule"; -// } -// -// @Override -// public String getDescription() { -// return "Doesn't do much"; -// } - } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties index 49944ff5e4..4d3e265b33 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties @@ -31,6 +31,6 @@ IngestMessagePanel.totalMessagesNameLabel.text=Total: IngestMessagePanel.totalMessagesNameVal.text=- IngestMessagePanel.totalUniqueMessagesNameLabel.text=Unique: IngestMessagePanel.totalUniqueMessagesNameVal.text=- -IngestConfigurationPanel.advancedButton.text=Advanced -IngestConfigurationPanel.processUnallocCheckbox.toolTipText=Processes unallocated space, such as deleted files. Produces more complete results, but it may take longer to process on large images. -IngestConfigurationPanel.processUnallocCheckbox.text=Process Unallocated Space +IngestJobConfigurationPanel.processUnallocCheckbox.toolTipText=Processes unallocated space, such as deleted files. Produces more complete results, but it may take longer to process on large images. +IngestJobConfigurationPanel.processUnallocCheckbox.text=Process Unallocated Space +IngestJobConfigurationPanel.advancedButton.text=Advanced diff --git a/Core/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java b/Core/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java index 43bca8ac6e..588926106a 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java @@ -35,54 +35,55 @@ import org.sleuthkit.datamodel.VolumeSystem; /** * Abstract visitor for getting all the files from content. */ - // TODO Could be moved to utility package, is there another version of this -// somewhere? - abstract class GetFilesContentVisitor implements ContentVisitor> { +// RJCTODO: Could this be moved to utility package, is there another version of this +// somewhere? An old comment said something about circular dependencies. Note: will use +// this for per ingest job progress bars. +abstract class GetFilesContentVisitor implements ContentVisitor> { - private static final Logger logger = Logger.getLogger(GetFilesContentVisitor.class.getName()); + private static final Logger logger = Logger.getLogger(GetFilesContentVisitor.class.getName()); - @Override - public Collection visit(VirtualDirectory ld) { - return getAllFromChildren(ld); - } - - @Override - public Collection visit(Directory drctr) { - return getAllFromChildren(drctr); - } + @Override + public Collection visit(VirtualDirectory ld) { + return getAllFromChildren(ld); + } - @Override - public Collection visit(Image image) { - return getAllFromChildren(image); - } + @Override + public Collection visit(Directory drctr) { + return getAllFromChildren(drctr); + } - @Override - public Collection visit(Volume volume) { - return getAllFromChildren(volume); - } + @Override + public Collection visit(Image image) { + return getAllFromChildren(image); + } - @Override - public Collection visit(VolumeSystem vs) { - return getAllFromChildren(vs); - } + @Override + public Collection visit(Volume volume) { + return getAllFromChildren(volume); + } - /** - * Aggregate all the matches from visiting the children Content objects of the - * one passed - * @param parent - * @return - */ - protected Collection getAllFromChildren(Content parent) { - Collection all = new ArrayList<>(); + @Override + public Collection visit(VolumeSystem vs) { + return getAllFromChildren(vs); + } - try { - for (Content child : parent.getChildren()) { - all.addAll(child.accept(this)); - } - } catch (TskException ex) { - logger.log(Level.SEVERE, "Error getting Content children", ex); - } + /** + * Aggregate all the matches from visiting the children Content objects of the + * one passed + * @param parent + * @return + */ + protected Collection getAllFromChildren(Content parent) { + Collection all = new ArrayList<>(); - return all; - } + try { + for (Content child : parent.getChildren()) { + all.addAll(child.accept(this)); + } + } catch (TskException ex) { + logger.log(Level.SEVERE, "Error getting Content children", ex); + } + + return all; + } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestDialog.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestDialog.java index b37530764d..4c467b9254 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestDialog.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestDialog.java @@ -34,21 +34,21 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import org.sleuthkit.datamodel.Content; -// RJCTODO: Rename to RunIngestModulesDialog after internationalization +// RJCTODO: Rename to RunIngestModulesDialog after internationalization. /** - * Dialog box that allows ingest modules to be run on an image. + * Dialog box that allows ingest modules to be run on a data source. * Used outside of the wizards. */ -public class IngestDialog extends JDialog { +public final class IngestDialog extends JDialog { private static final String TITLE = "Ingest Modules"; private static Dimension DIMENSIONS = new Dimension(500, 300); - private IngestConfigurator ingestConfigurator; + private IngestJobLauncher ingestConfigurator; public IngestDialog(JFrame frame, String title, boolean modal) { super(frame, title, modal); - ingestConfigurator = new IngestConfigurator(IngestDialog.class.getCanonicalName()); - List messages = ingestConfigurator.getMissingIngestModuleErrorMessages(); + ingestConfigurator = new IngestJobLauncher(IngestDialog.class.getCanonicalName()); + List messages = ingestConfigurator.getMissingIngestModuleMessages(); if (messages.isEmpty() == false) { StringBuilder warning = new StringBuilder(); for (String message : messages) { @@ -77,15 +77,15 @@ public class IngestDialog extends JDialog { // set the location of the popUp Window on the center of the screen setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2); - add(ingestConfigurator.getIngestConfigPanel(), BorderLayout.PAGE_START); + add(ingestConfigurator.getIngestJobConfigPanel(), BorderLayout.PAGE_START); JButton startButton = new JButton("Start"); JButton closeButton = new JButton("Close"); startButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - ingestConfigurator.save(); - ingestConfigurator.start(); + ingestConfigurator.saveIngestJobConfig(); + ingestConfigurator.startIngestJobs(); close(); } }); @@ -93,7 +93,7 @@ public class IngestDialog extends JDialog { @Override public void actionPerformed(ActionEvent e) { - ingestConfigurator.save(); + ingestConfigurator.saveIngestJobConfig(); close(); } }); @@ -101,7 +101,7 @@ public class IngestDialog extends JDialog { @Override public void windowClosing(WindowEvent e) { - ingestConfigurator.save(); + ingestConfigurator.saveIngestJobConfig(); close(); } }); @@ -118,8 +118,8 @@ public class IngestDialog extends JDialog { setVisible(true); } - public void setContent(List inputContent) { - ingestConfigurator.setContent(inputContent); + public void setDataSources(List inputContent) { + ingestConfigurator.setDataSourcesToIngest(inputContent); } /** diff --git a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestTask.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJob.java similarity index 94% rename from Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestTask.java rename to Core/src/org/sleuthkit/autopsy/ingest/IngestJob.java index 84b7215361..c7448c421d 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestTask.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJob.java @@ -33,7 +33,7 @@ import org.sleuthkit.datamodel.Content; * Encapsulates a data source and the ingest module pipelines to be used to * ingest the data source. */ -final class DataSourceIngestTask { +final class IngestJob { private final long id; private final Content dataSource; @@ -45,7 +45,7 @@ final class DataSourceIngestTask { private DataSourceIngestPipeline initialDataSourceIngestPipeline = null; private boolean cancelled; - DataSourceIngestTask(long id, Content dataSource, List ingestModuleTemplates, boolean processUnallocatedSpace) { + IngestJob(long id, Content dataSource, List ingestModuleTemplates, boolean processUnallocatedSpace) { this.id = id; this.dataSource = dataSource; this.ingestModuleTemplates = ingestModuleTemplates; @@ -92,7 +92,7 @@ final class DataSourceIngestTask { dataSourceIngestPipelines.put(threadId, pipeline); } else if (!dataSourceIngestPipelines.containsKey(threadId)) { pipeline = new DataSourceIngestPipeline(this, ingestModuleTemplates); - pipeline.startUp(); // RJCTODO: If time permits, return possible errors with pipeline or some such thing + pipeline.startUp(); // RJCTODO: Get errors and log dataSourceIngestPipelines.put(threadId, pipeline); } else { pipeline = dataSourceIngestPipelines.get(threadId); @@ -146,11 +146,11 @@ final class DataSourceIngestTask { static final class DataSourceIngestPipeline { private static final Logger logger = Logger.getLogger(DataSourceIngestPipeline.class.getName()); - private final DataSourceIngestTask task; + private final IngestJob task; private final List moduleTemplates; private List modules = new ArrayList<>(); - private DataSourceIngestPipeline(DataSourceIngestTask task, List moduleTemplates) { + private DataSourceIngestPipeline(IngestJob task, List moduleTemplates) { this.task = task; this.moduleTemplates = moduleTemplates; } @@ -169,7 +169,7 @@ final class DataSourceIngestTask { if (factory.isDataSourceIngestModuleFactory()) { IngestModuleSettings ingestOptions = template.getIngestOptions(); DataSourceIngestModuleDecorator module = new DataSourceIngestModuleDecorator(factory.createDataSourceIngestModule(ingestOptions), factory.getModuleDisplayName()); - IngestModuleContext context = new IngestModuleContext(task, factory); + IngestJobContext context = new IngestJobContext(task, factory); try { module.startUp(context); modulesByClass.put(module.getClassName(), module); @@ -250,7 +250,7 @@ final class DataSourceIngestTask { } @Override - public void startUp(IngestModuleContext context) throws Exception { + public void startUp(IngestJobContext context) throws Exception { module.startUp(context); } @@ -273,11 +273,11 @@ final class DataSourceIngestTask { static final class FileIngestPipeline { private static final Logger logger = Logger.getLogger(FileIngestPipeline.class.getName()); - private final DataSourceIngestTask task; + private final IngestJob task; private final List moduleTemplates; private List modules = new ArrayList<>(); - private FileIngestPipeline(DataSourceIngestTask task, List moduleTemplates) { + private FileIngestPipeline(IngestJob task, List moduleTemplates) { this.task = task; this.moduleTemplates = moduleTemplates; } @@ -296,7 +296,7 @@ final class DataSourceIngestTask { if (factory.isFileIngestModuleFactory()) { IngestModuleSettings ingestOptions = template.getIngestOptions(); FileIngestModuleDecorator module = new FileIngestModuleDecorator(factory.createFileIngestModule(ingestOptions), factory.getModuleDisplayName()); - IngestModuleContext context = new IngestModuleContext(task, factory); + IngestJobContext context = new IngestJobContext(task, factory); try { module.startUp(context); modulesByClass.put(module.getClassName(), module); @@ -376,7 +376,7 @@ final class DataSourceIngestTask { } @Override - public void startUp(IngestModuleContext context) throws Exception { + public void startUp(IngestJobContext context) throws Exception { module.startUp(context); } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestConfigurationPanel.form b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobConfigurationPanel.form similarity index 95% rename from Core/src/org/sleuthkit/autopsy/ingest/IngestConfigurationPanel.form rename to Core/src/org/sleuthkit/autopsy/ingest/IngestJobConfigurationPanel.form index 204ee54c11..ae6e4c7e93 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestConfigurationPanel.form +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobConfigurationPanel.form @@ -134,7 +134,7 @@ - + @@ -201,10 +201,10 @@ - + - + diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestConfigurationPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobConfigurationPanel.java similarity index 94% rename from Core/src/org/sleuthkit/autopsy/ingest/IngestConfigurationPanel.java rename to Core/src/org/sleuthkit/autopsy/ingest/IngestJobConfigurationPanel.java index 8d74d0ebb4..fa95efce67 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestConfigurationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobConfigurationPanel.java @@ -38,13 +38,13 @@ import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog; * User interface component to allow a user to set ingest module options and * enable/disable the modules. */ -class IngestConfigurationPanel extends javax.swing.JPanel { +class IngestJobConfigurationPanel extends javax.swing.JPanel { private List modules = new ArrayList<>(); private boolean processUnallocatedSpace = false; private IngestModuleModel selectedModule = null; - IngestConfigurationPanel(List moduleTemplates, boolean processUnallocatedSpace) { + IngestJobConfigurationPanel(List moduleTemplates, boolean processUnallocatedSpace) { for (IngestModuleTemplate moduleTemplate : moduleTemplates) { modules.add(new IngestModuleModel(moduleTemplate)); } @@ -157,7 +157,7 @@ class IngestConfigurationPanel extends javax.swing.JPanel { jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(160, 160, 160))); jPanel1.setPreferredSize(new java.awt.Dimension(338, 257)); - advancedButton.setText(org.openide.util.NbBundle.getMessage(IngestConfigurationPanel.class, "IngestConfigurationPanel.advancedButton.text")); // NOI18N + advancedButton.setText(org.openide.util.NbBundle.getMessage(IngestJobConfigurationPanel.class, "IngestJobConfigurationPanel.advancedButton.text")); // NOI18N advancedButton.setEnabled(false); advancedButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -195,8 +195,8 @@ class IngestConfigurationPanel extends javax.swing.JPanel { processUnallocPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(160, 160, 160))); - processUnallocCheckbox.setText(org.openide.util.NbBundle.getMessage(IngestConfigurationPanel.class, "IngestConfigurationPanel.processUnallocCheckbox.text")); // NOI18N - processUnallocCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(IngestConfigurationPanel.class, "IngestConfigurationPanel.processUnallocCheckbox.toolTipText")); // NOI18N + processUnallocCheckbox.setText(org.openide.util.NbBundle.getMessage(IngestJobConfigurationPanel.class, "IngestJobConfigurationPanel.processUnallocCheckbox.text")); // NOI18N + processUnallocCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(IngestJobConfigurationPanel.class, "IngestJobConfigurationPanel.processUnallocCheckbox.toolTipText")); // NOI18N processUnallocCheckbox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { processUnallocCheckboxActionPerformed(evt); @@ -295,18 +295,18 @@ class IngestConfigurationPanel extends javax.swing.JPanel { private final IngestModuleTemplate moduleTemplate; private IngestModuleGlobalSetttingsPanel resourcesConfigPanel = null; - private IngestModuleSettingsPanel ingestJobOptionsPanel = null; + private IngestModuleJobSettingsPanel ingestJobOptionsPanel = null; IngestModuleModel(IngestModuleTemplate moduleTemplate) { this.moduleTemplate = moduleTemplate; IngestModuleFactory moduleFactory = moduleTemplate.getIngestModuleFactory(); - if (moduleFactory.providesIngestJobOptionsPanels()) { - ingestJobOptionsPanel = moduleFactory.getIngestJobOptionsPanel(moduleTemplate.getIngestOptions()); + if (moduleFactory.providesModuleSettingsPanel()) { + ingestJobOptionsPanel = moduleFactory.getModuleSettingsPanel(moduleTemplate.getIngestOptions()); } - if (moduleFactory.providesResourcesConfigPanels()) { - resourcesConfigPanel = moduleFactory.getResourcesConfigPanel(); + if (moduleFactory.providesGlobalSettingsPanel()) { + resourcesConfigPanel = moduleFactory.getGlobalSettingsPanel(); } } @@ -331,15 +331,15 @@ class IngestConfigurationPanel extends javax.swing.JPanel { } boolean hasIngestOptionsPanel() { - return moduleTemplate.getIngestModuleFactory().providesIngestJobOptionsPanels(); + return moduleTemplate.getIngestModuleFactory().providesModuleSettingsPanel(); } - IngestModuleSettingsPanel getIngestOptionsPanel() { + IngestModuleJobSettingsPanel getIngestOptionsPanel() { return ingestJobOptionsPanel; } boolean hasResourcesConfigPanel() { - return moduleTemplate.getIngestModuleFactory().providesResourcesConfigPanels(); + return moduleTemplate.getIngestModuleFactory().providesGlobalSettingsPanel(); } IngestModuleGlobalSetttingsPanel getResourcesConfigPanel() { diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleContext.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobContext.java similarity index 94% rename from Core/src/org/sleuthkit/autopsy/ingest/IngestModuleContext.java rename to Core/src/org/sleuthkit/autopsy/ingest/IngestJobContext.java index 8d51e1a257..c56e7694b2 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleContext.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobContext.java @@ -32,16 +32,16 @@ import org.sleuthkit.datamodel.SleuthkitCase; * Acts as a facade for the parts of the ingest framework that make up the * processing context of an ingest module. */ -public final class IngestModuleContext { +public final class IngestJobContext { - private final DataSourceIngestTask ingestJob; + private final IngestJob ingestJob; private final IngestModuleFactory moduleFactory; private final IngestManager ingestManager; private final IngestScheduler scheduler; private final Case autopsyCase; private final SleuthkitCase sleuthkitCase; - IngestModuleContext(DataSourceIngestTask ingestJob, IngestModuleFactory moduleFactory) { + IngestJobContext(IngestJob ingestJob, IngestModuleFactory moduleFactory) { this.ingestJob = ingestJob; this.moduleFactory = moduleFactory; ingestManager = IngestManager.getDefault(); @@ -54,20 +54,10 @@ public final class IngestModuleContext { return this.ingestJob.isCancelled(); } - /** - * RJCTODO - * - * @return - */ public Case getCase() { return autopsyCase; } - /** - * RJCTODO - * - * @return - */ public SleuthkitCase getSleuthkitCase() { return sleuthkitCase; } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestConfigurator.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobLauncher.java similarity index 65% rename from Core/src/org/sleuthkit/autopsy/ingest/IngestConfigurator.java rename to Core/src/org/sleuthkit/autopsy/ingest/IngestJobLauncher.java index 2cde22c9ad..3c725f140e 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestConfigurator.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobLauncher.java @@ -25,33 +25,22 @@ import javax.swing.JPanel; import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.datamodel.Content; -/** - * RJCTODO: Improve comment Controller to allow a user to set context-sensitive - * ingest module options, enable/disable ingest modules, and set general ingest - * options. Provides an ingest module model class and instances of a UI - * component to its clients (Model-View-Controller design pattern). - */ -public class IngestConfigurator { +public final class IngestJobLauncher { private static final String ENABLED_INGEST_MODULES_KEY = "Enabled_Ingest_Modules"; private static final String DISABLED_INGEST_MODULES_KEY = "Disabled_Ingest_Modules"; private static final String PARSE_UNALLOC_SPACE_KEY = "Process_Unallocated_Space"; - private final String context; - private List missingIngestModuleErrorMessages = new ArrayList<>(); - private IngestConfigurationPanel ingestConfigPanel = null; - private List contentToIngest = null; // RJCTODO: Remove if start() method removed + private final String launcherContext; + private final List missingIngestModuleErrorMessages = new ArrayList<>(); + private final List dataSourcesToIngest = new ArrayList<>(); + private IngestJobConfigurationPanel ingestConfigPanel; - /** - * RJCTODO - * - * @param context - */ - public IngestConfigurator(String context) { - this.context = context; + public IngestJobLauncher(String launcherContext) { + this.launcherContext = launcherContext; // Get the ingest module factories discovered by the ingest module // loader. - // RJCTODO: Put in name uniqueness test/solution in loader! + // RJCTODO: Put in module name uniqueness test/notification either here or in the loader List moduleFactories = IngestModuleLoader.getInstance().getIngestModuleFactories(); HashSet loadedModuleNames = new HashSet<>(); for (IngestModuleFactory moduleFactory : moduleFactories) { @@ -67,10 +56,11 @@ public class IngestConfigurator { HashSet knownModuleNames = new HashSet<>(); List moduleTemplates = new ArrayList<>(); for (IngestModuleFactory moduleFactory : moduleFactories) { + // RJCTODO: Make sure there is a story in JIRA for this. // NOTE: In the future, this code will be modified to get the // resources configuration and ingest job options for each module // for the current context; for now just get the defaults. - IngestModuleSettings ingestOptions = moduleFactory.getDefaultIngestJobOptions(); + IngestModuleSettings ingestOptions = moduleFactory.getDefaultModuleSettings(); IngestModuleTemplate moduleTemplate = new IngestModuleTemplate(moduleFactory, ingestOptions); String moduleName = moduleTemplate.getIngestModuleFactory().getModuleDisplayName(); if (enabledModuleNames.contains(moduleName)) { @@ -94,48 +84,32 @@ public class IngestConfigurator { if (!knownModuleNames.contains(moduleName)) { missingIngestModuleErrorMessages.add(moduleName + " was previously enabled, but could not be found"); enabledModuleNames.remove(moduleName); - disabledModuleNames.add(moduleName); // RJCTODO: Is this the right behavior? + disabledModuleNames.add(moduleName); } } - ModuleSettings.setConfigSetting(context, ENABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(enabledModuleNames)); - ModuleSettings.setConfigSetting(context, DISABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(disabledModuleNames)); + ModuleSettings.setConfigSetting(launcherContext, ENABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(enabledModuleNames)); + ModuleSettings.setConfigSetting(launcherContext, DISABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(disabledModuleNames)); // Get the process unallocated space flag setting. If the setting does // not exist yet, default it to false. - if (ModuleSettings.settingExists(context, PARSE_UNALLOC_SPACE_KEY) == false) { - ModuleSettings.setConfigSetting(context, PARSE_UNALLOC_SPACE_KEY, "false"); + if (ModuleSettings.settingExists(launcherContext, PARSE_UNALLOC_SPACE_KEY) == false) { + ModuleSettings.setConfigSetting(launcherContext, PARSE_UNALLOC_SPACE_KEY, "false"); } - boolean processUnallocatedSpace = Boolean.parseBoolean(ModuleSettings.getConfigSetting(context, PARSE_UNALLOC_SPACE_KEY)); + boolean processUnallocatedSpace = Boolean.parseBoolean(ModuleSettings.getConfigSetting(launcherContext, PARSE_UNALLOC_SPACE_KEY)); // Make the configuration panel for the current context (view). - ingestConfigPanel = new IngestConfigurationPanel(moduleTemplates, processUnallocatedSpace); + ingestConfigPanel = new IngestJobConfigurationPanel(moduleTemplates, processUnallocatedSpace); } - /** - * RJCTODO - * - * @return - */ - public List getMissingIngestModuleErrorMessages() { + public List getMissingIngestModuleMessages() { return missingIngestModuleErrorMessages; } - /** - * RJCTODO - * - * @return - */ - public JPanel getIngestConfigPanel() { + public JPanel getIngestJobConfigPanel() { return ingestConfigPanel; } - /** - * RJCTODO - * - * @throws - * org.sleuthkit.autopsy.ingest.IngestConfigurator.IngestConfigurationException - */ - public void save() { + public void saveIngestJobConfig() { List moduleTemplates = ingestConfigPanel.getIngestModuleTemplates(); // Save the enabled/disabled ingest module settings for the current context. @@ -149,31 +123,24 @@ public class IngestConfigurator { disabledModuleNames.add(moduleName); } } - ModuleSettings.setConfigSetting(context, ENABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(enabledModuleNames)); - ModuleSettings.setConfigSetting(context, DISABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(disabledModuleNames)); + ModuleSettings.setConfigSetting(launcherContext, ENABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(enabledModuleNames)); + ModuleSettings.setConfigSetting(launcherContext, DISABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(disabledModuleNames)); // Save the process unallocated space setting for the current context. String processUnalloc = Boolean.toString(ingestConfigPanel.getProcessUnallocSpace()); - ModuleSettings.setConfigSetting(context, PARSE_UNALLOC_SPACE_KEY, processUnalloc); + ModuleSettings.setConfigSetting(launcherContext, PARSE_UNALLOC_SPACE_KEY, processUnalloc); // NOTE: In the future, this code will be modified to persist the ingest - // options for each ingest module for the current context. + // options for each ingest module for the current launch context. } - // RJCTODO: If time permits, make it so that this class is not responsible - // starting and running the ingest - probably need to do this anyway, at - // least if the IngestConfigurator interface goes away and this becomes the - // IngestConfigurator class. - public void setContent(List inputContent) { - this.contentToIngest = inputContent; + public void setDataSourcesToIngest(List dataSourcesToIngest) { + this.dataSourcesToIngest.clear(); + this.dataSourcesToIngest.addAll(dataSourcesToIngest); } - // RJCTODO: If time permits, make it so that this class is not responsible - // starting and running the ingest - probably need to do this anyway, at - // least if the IngestConfigurator interface goes away and this becomes the - // IngestConfigurator class. - public void start() { - // Filter out the disabled module tremplates. + public void startIngestJobs() { + // Filter out the disabled ingest module templates. List enabledModuleTemplates = new ArrayList<>(); List moduleTemplates = ingestConfigPanel.getIngestModuleTemplates(); for (IngestModuleTemplate moduleTemplate : moduleTemplates) { @@ -182,19 +149,11 @@ public class IngestConfigurator { } } - if ((!enabledModuleTemplates.isEmpty()) && (contentToIngest != null)) { - IngestManager.getDefault().scheduleDataSourceTasks(contentToIngest, enabledModuleTemplates, ingestConfigPanel.getProcessUnallocSpace()); + if ((!enabledModuleTemplates.isEmpty()) && (dataSourcesToIngest != null)) { + IngestManager.getDefault().scheduleDataSourceTasks(dataSourcesToIngest, enabledModuleTemplates, ingestConfigPanel.getProcessUnallocSpace()); } } - // RJCTODO: If time permits, make it so that this class is not responsible - // starting and running the ingest - probably need to do this anyway, at - // least if the IngestConfigurator interface goes away and this becomes the - // IngestConfigurator class. - public boolean isIngestRunning() { - return IngestManager.getDefault().isIngestRunning(); - } - private static String makeCommaSeparatedList(HashSet input) { if (input == null || input.isEmpty()) { return ""; @@ -210,15 +169,14 @@ public class IngestConfigurator { return csvList.toString(); } - // RJCTODO: May need additional mappings - EWF Verify to EWF Verifier private HashSet getModulesNamesFromSetting(String key, String defaultSetting) { // Get the ingest modules setting from the user's config file. // If there is no such setting yet, create the default setting. - if (ModuleSettings.settingExists(context, key) == false) { - ModuleSettings.setConfigSetting(context, key, defaultSetting); + if (ModuleSettings.settingExists(launcherContext, key) == false) { + ModuleSettings.setConfigSetting(launcherContext, key, defaultSetting); } HashSet moduleNames = new HashSet<>(); - String modulesSetting = ModuleSettings.getConfigSetting(context, key); + String modulesSetting = ModuleSettings.getConfigSetting(launcherContext, key); if (!modulesSetting.isEmpty()) { String[] settingNames = modulesSetting.split(", "); for (String name : settingNames) { @@ -231,6 +189,9 @@ public class IngestConfigurator { case "File Extension Mismatch Detection": moduleNames.add("Extension Mismatch Detector"); break; + case "EWF Verify": + moduleNames.add("EWF Verifier"); + break; default: moduleNames.add(name); } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index e4abe0ea51..4c53cad5e2 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -35,6 +35,8 @@ import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.Content; // RJCTODO: Fix comment +// RJCTODO: It woulod be really nice to move such a powerful class behind a +// facade. This is a good argument for IngestServices as the facade. /** * IngestManager sets up and manages ingest modules runs them in a background * thread notifies modules when work is complete or should be interrupted @@ -50,7 +52,7 @@ public class IngestManager { private static IngestManager instance; private final IngestScheduler scheduler; private final IngestMonitor ingestMonitor = new IngestMonitor(); - private final HashMap ingestJobs = new HashMap<>(); + private final HashMap ingestJobs = new HashMap<>(); private TaskSchedulingWorker taskSchedulingWorker; private FileTaskWorker fileTaskWorker; private DataSourceTaskWorker dataSourceTaskWorker; @@ -261,13 +263,13 @@ public class IngestManager { * @param pipelineContext ingest context used to ingest parent of the file * to be scheduled */ - void scheduleFileTask(long ingestJobId, AbstractFile file) { // RJCTODO: With the module context, this can be passed the task itself - DataSourceIngestTask job = this.ingestJobs.get(ingestJobId); // RJCTODO: Consider renaming + void scheduleFileTask(long ingestJobId, AbstractFile file) { // RJCTODO: Consider renaming method + IngestJob job = this.ingestJobs.get(ingestJobId); if (job == null) { // RJCTODO: Handle severe error } - scheduler.getFileScheduler().scheduleIngestOfDerivedFile(job, file); // RJCTODO: Consider renaming + scheduler.getFileScheduler().scheduleIngestOfDerivedFile(job, file); } /** @@ -282,30 +284,28 @@ public class IngestManager { * worker */ private synchronized void startAll() { - // RJCTODO: What does this do? if (!ingestMonitor.isRunning()) { ingestMonitor.start(); } if (scheduler.getDataSourceScheduler().hasNext()) { if (dataSourceTaskWorker == null || dataSourceTaskWorker.isDone()) { - dataSourceTaskWorker = new DataSourceTaskWorker(getNextThreadId()); // RJCTODO: May not need method call + dataSourceTaskWorker = new DataSourceTaskWorker(getNextThreadId()); dataSourceTaskWorker.execute(); } } if (scheduler.getFileScheduler().hasNext()) { if (fileTaskWorker == null || fileTaskWorker.isDone()) { - fileTaskWorker = new FileTaskWorker(getNextThreadId()); // RJCTODO: May not need method call + fileTaskWorker = new FileTaskWorker(getNextThreadId()); fileTaskWorker.execute(); } } } synchronized void reportThreadDone(long threadId) { - for (DataSourceIngestTask job : ingestJobs.values()) { + for (IngestJob job : ingestJobs.values()) { job.releaseIngestPipelinesForThread(threadId); - // RJCTODO: Add logging of errors or send ingest messages if (job.areIngestPipelinesShutDown()) { ingestJobs.remove(job.getId()); } @@ -326,7 +326,7 @@ public class IngestManager { // Now mark all of the ingest jobs as cancelled. This way the ingest // modules will know they are being shut down due to cancellation when // the ingest worker threads release their pipelines. - for (DataSourceIngestTask job : ingestJobs.values()) { + for (IngestJob job : ingestJobs.values()) { job.cancel(); } @@ -423,7 +423,7 @@ public class IngestManager { } final String inputName = dataSource.getName(); - DataSourceIngestTask ingestJob = new DataSourceIngestTask(IngestManager.this.getNextDataSourceTaskId(), dataSource, moduleTemplates, processUnallocatedSpace); + IngestJob ingestJob = new IngestJob(IngestManager.this.getNextDataSourceTaskId(), dataSource, moduleTemplates, processUnallocatedSpace); List errors = ingestJob.startUpIngestPipelines(); if (!errors.isEmpty()) { @@ -513,8 +513,8 @@ public class IngestManager { return null; } - DataSourceIngestTask ingestJob = scheduler.next(); - DataSourceIngestTask.DataSourceIngestPipeline pipeline = ingestJob.getDataSourceIngestPipelineForThread(this.id); + IngestJob ingestJob = scheduler.next(); + IngestJob.DataSourceIngestPipeline pipeline = ingestJob.getDataSourceIngestPipelineForThread(this.id); pipeline.process(this, this.progress); } @@ -588,7 +588,7 @@ public class IngestManager { IngestScheduler.FileScheduler.FileTask task = fileScheduler.next(); AbstractFile file = task.getFile(); progress.progress(file.getName(), processedFiles); - DataSourceIngestTask.FileIngestPipeline pipeline = task.getParent().getFileIngestPipelineForThread(this.id); + IngestJob.FileIngestPipeline pipeline = task.getParent().getFileIngestPipelineForThread(this.id); pipeline.process(file); // Update the progress bar. @@ -610,6 +610,7 @@ public class IngestManager { @Override protected void done() { + // RJCTODO: Why was GC done here in the old code? try { super.get(); } catch (CancellationException | InterruptedException e) { diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestModule.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestModule.java index 787d769a8a..a670f2c61d 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestModule.java @@ -29,7 +29,7 @@ public interface IngestModule { }; // RJCTODO: Write header comment, make sure to mention "one module instance per thread" - void startUp(IngestModuleContext context) throws Exception; + void startUp(IngestJobContext context) throws Exception; // RJCTODO: Write header comment, make sure to mention "one module instance per thread" void shutDown(boolean ingestJobWasCancelled); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleAdapter.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleAdapter.java index e304457944..26510f3475 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleAdapter.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleAdapter.java @@ -25,7 +25,7 @@ package org.sleuthkit.autopsy.ingest; public abstract class IngestModuleAdapter implements IngestModule { @Override - public void startUp(IngestModuleContext context) throws Exception { + public void startUp(IngestJobContext context) throws Exception { } @Override diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleError.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleError.java index 2b7501de7d..9c9910b405 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleError.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleError.java @@ -22,7 +22,7 @@ package org.sleuthkit.autopsy.ingest; * Encapsulates an exception thrown by an ingest module during an operation such * as startup or shut down with an exception object for the error that occurred. */ -class IngestModuleError { +final class IngestModuleError { private final String moduleDisplayName; private final Exception error; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactory.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactory.java index b5bf1dff7e..7de5d76064 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactory.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactory.java @@ -81,7 +81,7 @@ public interface IngestModuleFactory { * * @return True if the factory provides resource configuration panels. */ - boolean providesResourcesConfigPanels(); + boolean providesGlobalSettingsPanel(); /** * Gets a user interface panel that can be used to configure resources for @@ -104,7 +104,7 @@ public interface IngestModuleFactory { * the panel. * @return A user interface panel for configuring ingest module resources. */ - IngestModuleGlobalSetttingsPanel getResourcesConfigPanel(); + IngestModuleGlobalSetttingsPanel getGlobalSettingsPanel(); /** * Gets the default per ingest job options for instances of the family of @@ -117,7 +117,7 @@ public interface IngestModuleFactory { * * @return The ingest options. */ - IngestModuleSettings getDefaultIngestJobOptions(); + IngestModuleSettings getDefaultModuleSettings(); /** * Queries the factory to determine if it provides user interface panels to @@ -130,7 +130,7 @@ public interface IngestModuleFactory { * * @return True if the factory provides ingest job options panels. */ - boolean providesIngestJobOptionsPanels(); + boolean providesModuleSettingsPanel(); /** * Gets a user interface panel that can be used to set per ingest job @@ -152,7 +152,7 @@ public interface IngestModuleFactory { * @param ingestOptions Per ingest job options to initialize the panel. * @return A user interface panel. */ - IngestModuleSettingsPanel getIngestJobOptionsPanel(IngestModuleSettings ingestOptions); + IngestModuleJobSettingsPanel getModuleSettingsPanel(IngestModuleSettings ingestOptions); /** * Queries the factory to determine if it is capable of creating file ingest diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryAdapter.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryAdapter.java index 3aadf9bcf3..fc654b2981 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryAdapter.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryAdapter.java @@ -34,27 +34,27 @@ public abstract class IngestModuleFactoryAdapter implements IngestModuleFactory public abstract String getModuleVersionNumber(); @Override - public boolean providesResourcesConfigPanels() { + public boolean providesGlobalSettingsPanel() { return false; } @Override - public IngestModuleGlobalSetttingsPanel getResourcesConfigPanel() { + public IngestModuleGlobalSetttingsPanel getGlobalSettingsPanel() { throw new UnsupportedOperationException(); } @Override - public IngestModuleSettings getDefaultIngestJobOptions() { + public IngestModuleSettings getDefaultModuleSettings() { return new NoIngestModuleSettings(); } @Override - public boolean providesIngestJobOptionsPanels() { + public boolean providesModuleSettingsPanel() { return false; } @Override - public IngestModuleSettingsPanel getIngestJobOptionsPanel(IngestModuleSettings ingestOptions) { + public IngestModuleJobSettingsPanel getModuleSettingsPanel(IngestModuleSettings ingestOptions) { throw new UnsupportedOperationException(); } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleJobSettingsPanel.java similarity index 93% rename from Core/src/org/sleuthkit/autopsy/ingest/IngestModuleSettingsPanel.java rename to Core/src/org/sleuthkit/autopsy/ingest/IngestModuleJobSettingsPanel.java index 01d1226449..555ce81868 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleJobSettingsPanel.java @@ -23,7 +23,7 @@ import javax.swing.JPanel; /** * Abstract base class for ingest module per ingest job options panels. */ -public abstract class IngestModuleSettingsPanel extends JPanel { +public abstract class IngestModuleJobSettingsPanel extends JPanel { /** * Gets the ingest options for an ingest module. diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleLoader.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleLoader.java index 7257b60c69..e805fccd33 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleLoader.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleLoader.java @@ -35,13 +35,6 @@ final class IngestModuleLoader { private final List moduleFactories = new ArrayList<>(); private IngestModuleLoader() { - // RJCTODO: Possibly add code to listen to changes in the collection and restore listener code... - // RJCTODO: Need a name uniqueness test/solution? - Collection factories = Lookup.getDefault().lookupAll(IngestModuleFactory.class); - for (IngestModuleFactory factory : factories) { - logger.log(Level.INFO, "Found ingest module factory: name = {0}, version = {1}", new Object[]{factory.getModuleDisplayName(), factory.getModuleVersionNumber()}); - moduleFactories.add(factory); - } } synchronized static IngestModuleLoader getInstance() { @@ -51,7 +44,14 @@ final class IngestModuleLoader { return instance; } - List getIngestModuleFactories() { + synchronized List getIngestModuleFactories() { + moduleFactories.clear(); + // RJCTODO: Need a name uniqueness test/solution? + Collection factories = Lookup.getDefault().lookupAll(IngestModuleFactory.class); + for (IngestModuleFactory factory : factories) { + logger.log(Level.INFO, "Found ingest module factory: name = {0}, version = {1}", new Object[]{factory.getModuleDisplayName(), factory.getModuleVersionNumber()}); + moduleFactories.add(factory); + } return new ArrayList<>(moduleFactories); } } \ No newline at end of file diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleSettings.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleSettings.java index 6798436124..b55b0341c6 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleSettings.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleSettings.java @@ -26,12 +26,4 @@ import java.io.Serializable; * application. */ public interface IngestModuleSettings extends Serializable { - - // RJCTODO: Keep this as a shell if that works, otherwise go with Serializable - /** - * Determines whether the per ingest job options are valid. - * - * @return True if the options are valid, false otherwise. - */ - boolean areValid(); } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java index 958cfe2434..92f12c2180 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java @@ -38,7 +38,7 @@ import org.sleuthkit.autopsy.coreutils.PlatformUtil; */ public final class IngestMonitor { - public static final int DISK_FREE_SPACE_UNKNOWN = -1; // RJCTODO: This is ugly + public static final int DISK_FREE_SPACE_UNKNOWN = -1; private static final int INITIAL_INTERVAL_MS = 60000; //1 min. private final Logger logger = Logger.getLogger(IngestMonitor.class.getName()); private Timer timer; @@ -102,7 +102,7 @@ public final class IngestMonitor { return monitor.getFreeSpace(); } catch (SecurityException e) { logger.log(Level.WARNING, "Error checking for free disk space on ingest data drive", e); - return IngestServices.DISK_FREE_SPACE_UNKNOWN; + return DISK_FREE_SPACE_UNKNOWN; } } @@ -183,7 +183,7 @@ public final class IngestMonitor { //check if network drive, some network filesystems always return 0 final String monitoredPath = root.getAbsolutePath(); if (monitoredPath.startsWith("\\\\") || monitoredPath.startsWith("//")) { - return IngestServices.DISK_FREE_SPACE_UNKNOWN; + return DISK_FREE_SPACE_UNKNOWN; } } @@ -206,7 +206,7 @@ public final class IngestMonitor { return true; //OK } - if (freeSpace == IngestServices.DISK_FREE_SPACE_UNKNOWN) { + if (freeSpace == DISK_FREE_SPACE_UNKNOWN) { return true; } else { //logger.log(Level.INFO, "Checking free disk apce: " + freeSpace + " need: " + Long.toString(MIN_FREE_DISK_SPACE)); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestScheduler.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestScheduler.java index b5bc08bafa..909c59c51f 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestScheduler.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestScheduler.java @@ -148,11 +148,7 @@ final class IngestScheduler { return sb.toString(); } - synchronized void scheduleIngestOfFiles(DataSourceIngestTask dataSourceTask) { - // RJCTODO: This should go to the ingest manager as the job manager? - // Save the data source task to manage its pipelines. - //dataSourceTasks.put(dataSourceTask.getId(), dataSourceTask); - + synchronized void scheduleIngestOfFiles(IngestJob dataSourceTask) { Content dataSource = dataSourceTask.getDataSource(); Collection rootObjects = dataSource.accept(new GetRootDirVisitor()); List firstLevelFiles = new ArrayList<>(); @@ -188,7 +184,6 @@ final class IngestScheduler { FileTask fileTask = new FileTask(firstLevelFile, dataSourceTask); if (shouldEnqueueTask(fileTask)) { rootDirectoryTasks.add(fileTask); - // RJCTODO: Increment DataSourceTask counters (not necesssary if scanninf) } } @@ -199,7 +194,6 @@ final class IngestScheduler { updateQueues(); } - // RJCTODO: /** * Schedule a file to the file ingest, with associated modules. This * will add the file to beginning of the file queue. The method is @@ -212,7 +206,7 @@ final class IngestScheduler { * @param originalContext original content schedule context that was used * to schedule the parent origin content, with the modules, settings, etc. */ - synchronized void scheduleIngestOfDerivedFile(DataSourceIngestTask ingestJob, AbstractFile file) { + synchronized void scheduleIngestOfDerivedFile(IngestJob ingestJob, AbstractFile file) { FileTask fileTask = new FileTask(file, ingestJob); if (shouldEnqueueTask(fileTask)) { fileTasks.addFirst(fileTask); @@ -221,7 +215,6 @@ final class IngestScheduler { } } - // RJCTODO: Used? If not anymore, why? float getPercentageDone() { if (filesEnqueuedEst == 0) { return 0; @@ -229,7 +222,6 @@ final class IngestScheduler { return ((100.f) * filesDequeued) / filesEnqueuedEst; } - // RJCTODO: Used? If not anymore, why? /** * query num files enqueued total num of files to be enqueued. * @@ -252,7 +244,6 @@ final class IngestScheduler { return totalFiles; } - // RJCTODO: Used? If not anymore, why? /** * get total est. number of files to be enqueued for current ingest * input sources in queues @@ -263,7 +254,6 @@ final class IngestScheduler { return filesEnqueuedEst; } - // RJCTODO: Used? If not anymore, why? /** * Get number of files dequeued so far. This is reset after the same * content is enqueued that is already in a queue @@ -462,14 +452,14 @@ final class IngestScheduler { */ static class FileTask { private final AbstractFile file; - private final DataSourceIngestTask task; + private final IngestJob task; - public FileTask(AbstractFile file, DataSourceIngestTask task) { + public FileTask(AbstractFile file, IngestJob task) { this.file = file; this.task = task; } - public DataSourceIngestTask getParent() { // RJCTODO: Provide wrappers to get rid of train-style calls + public IngestJob getParent() { // RJCTODO: Provide wrappers to get rid of train-style calls return task; } @@ -509,8 +499,8 @@ final class IngestScheduler { if (this.file != other.file && (this.file == null || !this.file.equals(other.file))) { return false; } - DataSourceIngestTask thisTask = this.getParent(); - DataSourceIngestTask otherTask = other.getParent(); + IngestJob thisTask = this.getParent(); + IngestJob otherTask = other.getParent(); if (thisTask != otherTask && (thisTask == null || !thisTask.equals(otherTask))) { @@ -766,15 +756,15 @@ final class IngestScheduler { /** * DataSourceScheduler ingest scheduler */ - static class DataSourceScheduler implements Iterator { + static class DataSourceScheduler implements Iterator { - private LinkedList tasks; + private LinkedList tasks; DataSourceScheduler() { tasks = new LinkedList<>(); } - synchronized void schedule(DataSourceIngestTask task) { + synchronized void schedule(IngestJob task) { try { if (task.getDataSource().getParent() != null) { //only accepting parent-less content objects (Image, parentless VirtualDirectory) @@ -790,12 +780,12 @@ final class IngestScheduler { } @Override - public synchronized DataSourceIngestTask next() throws IllegalStateException { + public synchronized IngestJob next() throws IllegalStateException { if (!hasNext()) { throw new IllegalStateException("There is no data source tasks in the queue, check hasNext()"); } - final DataSourceIngestTask ret = tasks.pollFirst(); + final IngestJob ret = tasks.pollFirst(); return ret; } @@ -806,7 +796,7 @@ final class IngestScheduler { */ synchronized List getContents() { List contents = new ArrayList(); - for (DataSourceIngestTask task : tasks) { + for (IngestJob task : tasks) { contents.add(task.getDataSource()); } return contents; @@ -834,7 +824,7 @@ final class IngestScheduler { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("DataSourceQueue, size: ").append(getCount()); - for (DataSourceIngestTask task : tasks) { + for (IngestJob task : tasks) { sb.append(task.toString()).append(" "); } return sb.toString(); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java index b318145b17..4cafc001de 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java @@ -18,14 +18,10 @@ */ package org.sleuthkit.autopsy.ingest; -import java.io.File; -import java.util.Collection; -import java.util.List; import java.util.logging.Level; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.AbstractFile; -import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.SleuthkitCase; /** @@ -34,7 +30,6 @@ import org.sleuthkit.datamodel.SleuthkitCase; * singleton instance. */ public final class IngestServices { - public static final int DISK_FREE_SPACE_UNKNOWN = -1; // RJCTODO: Move this back to the monitor or ingest manager? It is used here... private static final Logger logger = Logger.getLogger(IngestServices.class.getName()); private IngestManager manager; @@ -151,4 +146,6 @@ public final class IngestServices { public long getFreeDiskSpace() { return manager.getFreeDiskSpace(); } + + // RJCTODO: Add properties methods back into IngestServices } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/ModuleContentEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/ModuleContentEvent.java index ec1ec6a383..27f9badedb 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/ModuleContentEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/ModuleContentEvent.java @@ -21,7 +21,7 @@ package org.sleuthkit.autopsy.ingest; import javax.swing.event.ChangeEvent; import org.sleuthkit.datamodel.Content; -// RJCTODO: Really? +// RJCTODO: Rename /** * Event data that are fired off by ingest modules when they changed or added new content. */ diff --git a/Core/src/org/sleuthkit/autopsy/ingest/ModuleDataEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/ModuleDataEvent.java index acfae1a779..7b2862f6e6 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/ModuleDataEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/ModuleDataEvent.java @@ -38,6 +38,7 @@ import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE; * * By design, only a single type of artifacts can be contained in a single data event. */ +// RJCTODO: Rename public class ModuleDataEvent extends ChangeEvent { private String moduleName; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/NoIngestModuleSettings.java b/Core/src/org/sleuthkit/autopsy/ingest/NoIngestModuleSettings.java index e8944ed5bc..1fb3b709f1 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/NoIngestModuleSettings.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/NoIngestModuleSettings.java @@ -24,7 +24,7 @@ package org.sleuthkit.autopsy.ingest; */ public final class NoIngestModuleSettings implements IngestModuleSettings { - private final String options = "None"; + private final String setting = "None"; /** * Gets the string used as an ingest options placeholder for serialization @@ -32,12 +32,7 @@ public final class NoIngestModuleSettings implements IngestModuleSettings { * * @return The string "None" */ - String getOptions() { - return options; - } - - @Override - public boolean areValid() { - return true; + String getSetting() { + return setting; } } diff --git a/ExifParser/src/org/sleuthkit/autopsy/exifparser/ExifParserFileIngestModule.java b/ExifParser/src/org/sleuthkit/autopsy/exifparser/ExifParserFileIngestModule.java index ff63438a5d..78b5aba744 100644 --- a/ExifParser/src/org/sleuthkit/autopsy/exifparser/ExifParserFileIngestModule.java +++ b/ExifParser/src/org/sleuthkit/autopsy/exifparser/ExifParserFileIngestModule.java @@ -65,7 +65,7 @@ public final class ExifParserFileIngestModule extends IngestModuleAdapter implem } @Override - public void startUp(org.sleuthkit.autopsy.ingest.IngestModuleContext context) throws Exception { + public void startUp(org.sleuthkit.autopsy.ingest.IngestJobContext context) throws Exception { super.startUp(context); services = IngestServices.getDefault(); logger.log(Level.INFO, "init() {0}", this.toString()); diff --git a/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchConfigPanel.java b/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchConfigPanel.java index 5e2b395eb4..bf748bea40 100644 --- a/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchConfigPanel.java +++ b/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchConfigPanel.java @@ -24,16 +24,13 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; -import java.util.logging.Level; import javax.swing.JOptionPane; import javax.swing.ListSelectionModel; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.AbstractTableModel; import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel; -//import org.sleuthkit.autopsy.corecomponents.OptionsPanel; -//import org.sleuthkit.autopsy.coreutils.Logger; -//import org.sleuthkit.autopsy.filetypeid.FileTypeIdIngestModule; RJCTODO +import org.sleuthkit.autopsy.filetypeid.FileTypeIdIngestModule; /** * Container panel for File Extension Mismatch Ingest Module advanced configuration options @@ -404,12 +401,11 @@ final class FileExtMismatchConfigPanel extends IngestModuleGlobalSetttingsPanel return; } - // RJCTODO -// if (!FileTypeIdIngestModule.isMimeTypeDetectable(newMime)) { -// mimeErrLabel.setForeground(Color.red); -// mimeErrLabel.setText("MIME type is not detectable by this module."); -// return; -// } + if (!FileTypeIdIngestModule.isMimeTypeDetectable(newMime)) { + mimeErrLabel.setForeground(Color.red); + mimeErrLabel.setText("MIME type is not detectable by this module."); + return; + } editableMap.put(newMime, new String[0]); @@ -505,29 +501,27 @@ final class FileExtMismatchConfigPanel extends IngestModuleGlobalSetttingsPanel @Override public void load() { - // RJCTODO // Load the XML into a buffer that the user can modify. They can choose // to save it back to the file after making changes. -// editableMap = FileExtMismatchXML.getDefault().load(); + editableMap = FileExtMismatchXML.getDefault().load(); updateMimeList(); updateExtList(); } @Override public void store() { - // RJCTODO -// if (FileExtMismatchXML.getDefault().save(editableMap)) { -// mimeErrLabel.setText(" "); -// mimeRemoveErrLabel.setText(" "); -// extRemoveErrLabel.setText(" "); -// extErrorLabel.setText(" "); -// -// saveMsgLabel.setText("Saved."); -// saveButton.setEnabled(false); -// } else { -// //error -// JOptionPane.showMessageDialog(this, "Writing XML configuration file failed.", "Save Error", JOptionPane.ERROR_MESSAGE); -// } + if (FileExtMismatchXML.getDefault().save(editableMap)) { + mimeErrLabel.setText(" "); + mimeRemoveErrLabel.setText(" "); + extRemoveErrLabel.setText(" "); + extErrorLabel.setText(" "); + + saveMsgLabel.setText("Saved."); + saveButton.setEnabled(false); + } else { + //error + JOptionPane.showMessageDialog(this, "Writing XML configuration file failed.", "Save Error", JOptionPane.ERROR_MESSAGE); + } } private void setIsModified() { diff --git a/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchDetectorModuleFactory.java b/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchDetectorModuleFactory.java index ae3447dbfb..ffc6edce33 100755 --- a/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchDetectorModuleFactory.java +++ b/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchDetectorModuleFactory.java @@ -24,7 +24,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter; import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.autopsy.ingest.IngestModuleFactory; import org.sleuthkit.autopsy.ingest.IngestModuleSettings; -import org.sleuthkit.autopsy.ingest.IngestModuleSettingsPanel; +import org.sleuthkit.autopsy.ingest.IngestModuleJobSettingsPanel; import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel; /** @@ -57,28 +57,28 @@ public class FileExtMismatchDetectorModuleFactory extends IngestModuleFactoryAda } @Override - public IngestModuleSettings getDefaultIngestJobOptions() { + public IngestModuleSettings getDefaultModuleSettings() { return new FileExtMismatchDetectorOptions(); } @Override - public boolean providesIngestJobOptionsPanels() { + public boolean providesModuleSettingsPanel() { return true; } @Override - public IngestModuleSettingsPanel getIngestJobOptionsPanel(IngestModuleSettings ingestOptions) { + public IngestModuleJobSettingsPanel getModuleSettingsPanel(IngestModuleSettings ingestOptions) { FileExtMismatchSimpleConfigPanel ingestOptionsPanel = new FileExtMismatchSimpleConfigPanel((FileExtMismatchDetectorOptions) ingestOptions); return ingestOptionsPanel; } @Override - public boolean providesResourcesConfigPanels() { + public boolean providesGlobalSettingsPanel() { return true; } @Override - public IngestModuleGlobalSetttingsPanel getResourcesConfigPanel() { + public IngestModuleGlobalSetttingsPanel getGlobalSettingsPanel() { FileExtMismatchConfigPanel globalOptionsPanel = new FileExtMismatchConfigPanel(); globalOptionsPanel.load(); return globalOptionsPanel; diff --git a/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchDetectorOptions.java b/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchDetectorOptions.java index 9e03172028..8a4f6992fd 100755 --- a/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchDetectorOptions.java +++ b/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchDetectorOptions.java @@ -61,9 +61,4 @@ public class FileExtMismatchDetectorOptions implements IngestModuleSettings { boolean getSkipFilesWithTextPlainMimeType() { return skipFilesWithTextPlainMimeType; } - - @Override - public boolean areValid() { - return true; - } } diff --git a/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchIngestModule.java b/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchIngestModule.java index 5abbdabb50..3d95ef8037 100644 --- a/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchIngestModule.java +++ b/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchIngestModule.java @@ -58,7 +58,7 @@ public class FileExtMismatchIngestModule extends IngestModuleAdapter implements } @Override - public void startUp(org.sleuthkit.autopsy.ingest.IngestModuleContext context) throws Exception { + public void startUp(org.sleuthkit.autopsy.ingest.IngestJobContext context) throws Exception { super.startUp(context); services = IngestServices.getDefault(); FileExtMismatchXML xmlLoader = FileExtMismatchXML.getDefault(); @@ -168,15 +168,17 @@ public class FileExtMismatchIngestModule extends IngestModuleAdapter implements services.postMessage(IngestMessage.createMessage(++messageId, IngestMessage.MessageType.INFO, FileExtMismatchDetectorModuleFactory.getModuleName(), "File Extension Mismatch Results", detailsSb.toString())); } - // RJCTODO: Ingest options! + // RJCTODO: Ingest setting public void setSkipKnown(boolean flag) { skipKnown = flag; } + // RJCTODO: Ingest setting public void setSkipNoExt(boolean flag) { skipNoExt = flag; } + // RJCTODO: Ingest setting public void setSkipTextPlain(boolean flag) { skipTextPlain = flag; } diff --git a/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchSimpleConfigPanel.java b/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchSimpleConfigPanel.java index dff60ee891..bee781c7e5 100644 --- a/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchSimpleConfigPanel.java +++ b/FileExtMismatch/src/org/sleuthkit/autopsy/fileextmismatch/FileExtMismatchSimpleConfigPanel.java @@ -19,13 +19,13 @@ package org.sleuthkit.autopsy.fileextmismatch; import org.sleuthkit.autopsy.ingest.IngestModuleSettings; -import org.sleuthkit.autopsy.ingest.IngestModuleSettingsPanel; +import org.sleuthkit.autopsy.ingest.IngestModuleJobSettingsPanel; /** * UI component used to set ingest job options for file extension mismatch * detector ingest modules. */ -class FileExtMismatchSimpleConfigPanel extends IngestModuleSettingsPanel { +class FileExtMismatchSimpleConfigPanel extends IngestModuleJobSettingsPanel { private FileExtMismatchDetectorOptions ingestJobOptions; diff --git a/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdIngestModule.java b/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdIngestModule.java index a4bb3ff4b5..b29645c5aa 100644 --- a/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdIngestModule.java +++ b/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdIngestModule.java @@ -105,4 +105,14 @@ public class FileTypeIdIngestModule extends IngestModuleAdapter implements FileI detailsSb.append(""); IngestServices.getDefault().postMessage(IngestMessage.createMessage(++messageId, IngestMessage.MessageType.INFO, FileTypeIdentifierModuleFactory.getModuleName(), "File Type Id Results", detailsSb.toString())); } + + /** + * Validate if a given mime type is in the detector's registry. + * @param mimeType Full string of mime type, e.g. "text/html" + * @return true if detectable + */ + public static boolean isMimeTypeDetectable(String mimeType) { + FileTypeDetectionInterface detector = new TikaFileTypeDetector(); + return detector.isMimeTypeDetectable(mimeType); + } } \ No newline at end of file diff --git a/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdSimpleConfigPanel.java b/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdSimpleConfigPanel.java index b3ae75e500..50c6e00a0d 100644 --- a/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdSimpleConfigPanel.java +++ b/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdSimpleConfigPanel.java @@ -19,13 +19,13 @@ package org.sleuthkit.autopsy.filetypeid; import org.sleuthkit.autopsy.ingest.IngestModuleSettings; -import org.sleuthkit.autopsy.ingest.IngestModuleSettingsPanel; +import org.sleuthkit.autopsy.ingest.IngestModuleJobSettingsPanel; /** * UI component used to set ingest job options for file type identifier ingest * modules. */ -class FileTypeIdSimpleConfigPanel extends IngestModuleSettingsPanel { +class FileTypeIdSimpleConfigPanel extends IngestModuleJobSettingsPanel { private final FileTypeIdentifierIngestJobOptions ingestJobOptions; diff --git a/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdentifierIngestJobOptions.java b/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdentifierIngestJobOptions.java index 5d565b551d..23ea234412 100755 --- a/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdentifierIngestJobOptions.java +++ b/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdentifierIngestJobOptions.java @@ -41,9 +41,4 @@ public class FileTypeIdentifierIngestJobOptions implements IngestModuleSettings boolean shouldSkipKnownFiles() { return skipKnownFiles; } - - @Override - public boolean areValid() { - return true; - } } \ No newline at end of file diff --git a/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdentifierModuleFactory.java b/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdentifierModuleFactory.java index 9e698d860f..23e700d0db 100755 --- a/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdentifierModuleFactory.java +++ b/FileTypeId/src/org/sleuthkit/autopsy/filetypeid/FileTypeIdentifierModuleFactory.java @@ -24,7 +24,7 @@ import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.autopsy.ingest.IngestModuleFactory; import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter; import org.sleuthkit.autopsy.ingest.IngestModuleSettings; -import org.sleuthkit.autopsy.ingest.IngestModuleSettingsPanel; +import org.sleuthkit.autopsy.ingest.IngestModuleJobSettingsPanel; /** * An factory that creates file ingest modules that determine the types of @@ -56,17 +56,17 @@ public class FileTypeIdentifierModuleFactory extends IngestModuleFactoryAdapter } @Override - public IngestModuleSettings getDefaultIngestJobOptions() { + public IngestModuleSettings getDefaultModuleSettings() { return new FileTypeIdentifierIngestJobOptions(); } @Override - public boolean providesIngestJobOptionsPanels() { + public boolean providesModuleSettingsPanel() { return true; } @Override - public IngestModuleSettingsPanel getIngestJobOptionsPanel(IngestModuleSettings ingestJobOptions) { + public IngestModuleJobSettingsPanel getModuleSettingsPanel(IngestModuleSettings ingestJobOptions) { return new FileTypeIdSimpleConfigPanel((FileTypeIdentifierIngestJobOptions) ingestJobOptions); } diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/AddContentToHashDbAction.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/AddContentToHashDbAction.java index 93789e0308..c94b2c95e0 100755 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/AddContentToHashDbAction.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/AddContentToHashDbAction.java @@ -32,11 +32,12 @@ import org.openide.util.NbBundle; import org.openide.util.Utilities; import org.openide.util.Lookup; import org.openide.util.actions.Presenter; -import org.sleuthkit.autopsy.ingest.IngestConfigurator; +import org.sleuthkit.autopsy.ingest.IngestJobLauncher; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.TskCoreException; import static org.sleuthkit.autopsy.hashdatabase.HashDbManager.HashDb; +import org.sleuthkit.autopsy.ingest.IngestManager; /** * Instances of this Action allow users to content to a hash database. @@ -81,8 +82,7 @@ final class AddContentToHashDbAction extends AbstractAction implements Presenter super(SINGLE_SELECTION_NAME); // Disable the menu if file ingest is in progress. - IngestConfigurator ingestConfigurator = Lookup.getDefault().lookup(IngestConfigurator.class); - if (null != ingestConfigurator && ingestConfigurator.isIngestRunning()) { + if (IngestManager.getDefault().isIngestRunning()) { setEnabled(false); return; } diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestModule.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestModule.java index 966e2c9890..bd073bf2b0 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestModule.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestModule.java @@ -44,7 +44,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleAdapter; import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.datamodel.HashInfo; -// RJCTODO: Storeis for a) peristing context-sensitive module settings and b) adapt core modules to use module settings (more important) +// RJCTODO: Create stories for a) peristing context-sensitive module settings and b) adapt core modules to use module settings (more important) public class HashDbIngestModule extends IngestModuleAdapter implements FileIngestModule { private static final Logger logger = Logger.getLogger(HashDbIngestModule.class.getName()); private static final int MAX_COMMENT_SIZE = 500; @@ -63,7 +63,7 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges } @Override - public void startUp(org.sleuthkit.autopsy.ingest.IngestModuleContext context) throws Exception { + public void startUp(org.sleuthkit.autopsy.ingest.IngestJobContext context) throws Exception { super.startUp(context); services = IngestServices.getDefault(); skCase = Case.getCurrentCase().getSleuthkitCase(); diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSimpleConfigPanel.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSimpleConfigPanel.java index ede737c0af..d42eaf1e09 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSimpleConfigPanel.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSimpleConfigPanel.java @@ -33,12 +33,12 @@ import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.autopsy.hashdatabase.HashDbManager.HashDb; import org.sleuthkit.autopsy.ingest.IngestModuleSettings; -import org.sleuthkit.autopsy.ingest.IngestModuleSettingsPanel; +import org.sleuthkit.autopsy.ingest.IngestModuleJobSettingsPanel; /** * Instances of this class provide a simplified UI for managing the hash sets configuration. */ -public class HashDbSimpleConfigPanel extends IngestModuleSettingsPanel { +public class HashDbSimpleConfigPanel extends IngestModuleJobSettingsPanel { private HashDatabasesTableModel knownTableModel; private HashDatabasesTableModel knownBadTableModel; @@ -77,7 +77,6 @@ public class HashDbSimpleConfigPanel extends IngestModuleSettingsPanel { @Override public IngestModuleSettings getIngestJobOptions() { - // RJCTODO: Work out how this works, load() and store(), etc. HashDbManager hashDbManager = HashDbManager.getInstance(); List knownFileHashSets = hashDbManager.getKnownFileHashSets(); List knownBadFileHashSets = hashDbManager.getKnownBadFileHashSets(); diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupModuleFactory.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupModuleFactory.java index e94f98262e..46ea9f6736 100755 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupModuleFactory.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupModuleFactory.java @@ -25,7 +25,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter; import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.autopsy.ingest.IngestModuleFactory; import org.sleuthkit.autopsy.ingest.IngestModuleSettings; -import org.sleuthkit.autopsy.ingest.IngestModuleSettingsPanel; +import org.sleuthkit.autopsy.ingest.IngestModuleJobSettingsPanel; import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel; /** @@ -54,29 +54,29 @@ public class HashLookupModuleFactory extends IngestModuleFactoryAdapter { } @Override - public IngestModuleSettings getDefaultIngestJobOptions() { + public IngestModuleSettings getDefaultModuleSettings() { return new HashLookupOptions(); } @Override - public boolean providesIngestJobOptionsPanels() { + public boolean providesModuleSettingsPanel() { return true; } @Override - public IngestModuleSettingsPanel getIngestJobOptionsPanel(IngestModuleSettings ingestOptions) { + public IngestModuleJobSettingsPanel getModuleSettingsPanel(IngestModuleSettings ingestOptions) { HashDbSimpleConfigPanel ingestOptionsPanel = new HashDbSimpleConfigPanel(); ingestOptionsPanel.load(); return ingestOptionsPanel; } @Override - public boolean providesResourcesConfigPanels() { + public boolean providesGlobalSettingsPanel() { return true; } @Override - public IngestModuleGlobalSetttingsPanel getResourcesConfigPanel() { + public IngestModuleGlobalSetttingsPanel getGlobalSettingsPanel() { HashDbConfigPanel resourcesConfigPanel = new HashDbConfigPanel(); resourcesConfigPanel.load(); return resourcesConfigPanel; diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupOptions.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupOptions.java index 9bb0de4673..49877b9cd2 100755 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupOptions.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupOptions.java @@ -28,6 +28,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleSettings; // Note that this class is not yet used as intended. public class HashLookupOptions implements IngestModuleSettings { + // RJCTODO: These should not be handle objects, but names or files private boolean shouldCalculateHashes = true; private ArrayList knownFileHashSets; private ArrayList knownBadFileHashSets; @@ -44,12 +45,6 @@ public class HashLookupOptions implements IngestModuleSettings { this.knownBadFileHashSets = new ArrayList<>(knownBadFileHashSets); } - @Override - public boolean areValid() { - // RJCTODO: Verify that hash sets are present in hash db manager - return true; - } - boolean shouldCalculateHashes() { return shouldCalculateHashes; } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordList.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordList.java index e27412c2d4..093d9462f1 100755 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordList.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordList.java @@ -21,9 +21,6 @@ package org.sleuthkit.autopsy.keywordsearch; import java.util.Date; import java.util.List; -/** - * RJCTODO - */ public class KeywordList { private String name; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java index de0c656d8c..539d990af6 100755 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java @@ -54,7 +54,7 @@ import org.sleuthkit.autopsy.ingest.IngestServices; import org.sleuthkit.autopsy.ingest.IngestMessage; import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType; import org.sleuthkit.autopsy.ingest.IngestModuleAdapter; -import org.sleuthkit.autopsy.ingest.IngestModuleContext; +import org.sleuthkit.autopsy.ingest.IngestJobContext; import org.sleuthkit.autopsy.ingest.ModuleDataEvent; import org.sleuthkit.autopsy.keywordsearch.Ingester.IngesterException; import org.sleuthkit.datamodel.BlackboardArtifact; @@ -117,8 +117,6 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme private volatile int messageID = 0; private boolean processedFiles; private volatile boolean finalSearcherDone = true; //mark as done, until it's inited - private final String hashDBModuleName = NbBundle - .getMessage(this.getClass(), "KeywordSearchIngestModule.hashDbModuleName"); //NOTE this needs to match the HashDB module getName() private SleuthkitCase caseHandle = null; private static List textExtractors; private static AbstractFileStringExtract stringExtractor; @@ -161,15 +159,6 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme return ResultCode.OK; } - // RJCTODO: Resolve this - //check if we should index meta-data only when 1) it is known 2) HashDb module errored on it -// if (services.getAbstractFileModuleResult(hashDBModuleName) == ResultCode.ERROR) { -// indexer.indexFile(abstractFile, false); -// //notify depending module that keyword search (would) encountered error for this file -// ingestStatus.put(abstractFile.getId(), IngestStatus.SKIPPED_ERROR_IO); -// return ResultCode.ERROR; -// } -// else if (KeywordSearchSettings.getSkipKnown() && abstractFile.getKnown().equals(FileKnown.KNOWN)) { if (KeywordSearchSettings.getSkipKnown() && abstractFile.getKnown().equals(FileKnown.KNOWN)) { //index meta-data only indexer.indexFile(abstractFile, false); @@ -298,7 +287,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme * */ @Override - public void startUp(IngestModuleContext context) throws Exception { + public void startUp(IngestJobContext context) throws Exception { super.startUp(context); logger.log(Level.INFO, "init()"); services = IngestServices.getDefault(); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestSimplePanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestSimplePanel.java index 7be2f3224e..1e639cdc0e 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestSimplePanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestSimplePanel.java @@ -28,13 +28,13 @@ import javax.swing.table.AbstractTableModel; import javax.swing.table.TableColumn; import org.sleuthkit.autopsy.coreutils.StringExtract.StringExtractUnicodeTable.SCRIPT; import org.sleuthkit.autopsy.ingest.IngestModuleSettings; -import org.sleuthkit.autopsy.ingest.IngestModuleSettingsPanel; +import org.sleuthkit.autopsy.ingest.IngestModuleJobSettingsPanel; import org.sleuthkit.autopsy.ingest.NoIngestModuleSettings; /** * Ingest job options panel for the keyword search file ingest module. */ -public class KeywordSearchIngestSimplePanel extends IngestModuleSettingsPanel { +public class KeywordSearchIngestSimplePanel extends IngestModuleJobSettingsPanel { private final static Logger logger = Logger.getLogger(KeywordSearchIngestSimplePanel.class.getName()); public static final String PROP_OPTIONS = "Keyword Search_Options"; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchListsAbstract.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchListsAbstract.java index 12ae51aa11..eeb3d57f33 100755 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchListsAbstract.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchListsAbstract.java @@ -37,9 +37,9 @@ import java.util.logging.Level; */ abstract class KeywordSearchListsAbstract { - protected String filePath; // RJCTODO: Doubt this needs to be protected - Map theLists; //the keyword data // RJCTODO: This shuld be used to accumulate the lists read in - static KeywordSearchListsXML currentInstance = null; // RJCTODO: This is inappropriate for a reader + protected String filePath; + Map theLists; //the keyword data + static KeywordSearchListsXML currentInstance = null; private static final String CUR_LISTS_FILE_NAME = "keywords.xml"; // RJCTODO: This will go to the manager private static String CUR_LISTS_FILE = PlatformUtil.getUserConfigDirectory() + File.separator + CUR_LISTS_FILE_NAME; // RJCTODO: This will go to the manager protected static final Logger logger = Logger.getLogger(KeywordSearchListsAbstract.class.getName()); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchModuleFactory.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchModuleFactory.java index 1e7a6d6c3b..81c200add9 100755 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchModuleFactory.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchModuleFactory.java @@ -26,7 +26,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter; import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.autopsy.ingest.IngestModuleFactory; import org.sleuthkit.autopsy.ingest.IngestModuleSettings; -import org.sleuthkit.autopsy.ingest.IngestModuleSettingsPanel; +import org.sleuthkit.autopsy.ingest.IngestModuleJobSettingsPanel; import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel; /** @@ -55,24 +55,24 @@ public class KeywordSearchModuleFactory extends IngestModuleFactoryAdapter { } @Override - public boolean providesIngestJobOptionsPanels() { + public boolean providesModuleSettingsPanel() { return true; } @Override - public IngestModuleSettingsPanel getIngestJobOptionsPanel(IngestModuleSettings ingestJobOptions) { + public IngestModuleJobSettingsPanel getModuleSettingsPanel(IngestModuleSettings ingestJobOptions) { KeywordSearchIngestSimplePanel ingestOptionsPanel = new KeywordSearchIngestSimplePanel(); ingestOptionsPanel.load(); return ingestOptionsPanel; } @Override - public boolean providesResourcesConfigPanels() { + public boolean providesGlobalSettingsPanel() { return true; } @Override - public IngestModuleGlobalSetttingsPanel getResourcesConfigPanel() { + public IngestModuleGlobalSetttingsPanel getGlobalSettingsPanel() { KeywordSearchConfigurationPanel globalOptionsPanel = new KeywordSearchConfigurationPanel(); globalOptionsPanel.load(); return globalOptionsPanel; diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/RAImageIngestModule.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/RAImageIngestModule.java index 8880dca0c6..6064d37741 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/RAImageIngestModule.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/RAImageIngestModule.java @@ -36,7 +36,7 @@ import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType; import org.sleuthkit.datamodel.Content; import org.sleuthkit.autopsy.ingest.IngestModule.ResultCode; import org.sleuthkit.autopsy.ingest.IngestModuleAdapter; -import org.sleuthkit.autopsy.ingest.IngestModuleContext; +import org.sleuthkit.autopsy.ingest.IngestJobContext; /** * Recent activity image ingest module @@ -140,7 +140,7 @@ public final class RAImageIngestModule extends IngestModuleAdapter implements Da } @Override - public void startUp(IngestModuleContext context) throws Exception { + public void startUp(IngestJobContext context) throws Exception { services = IngestServices.getDefault(); Extract registry = new ExtractRegistry(); @@ -155,7 +155,7 @@ public final class RAImageIngestModule extends IngestModuleAdapter implements Da extracters.add(iexplore); extracters.add(recentDocuments); extracters.add(SEUQA); // this needs to run after the web browser modules - extracters.add(registry); // this runs last because it is slowest // RJCTODO: Why? + extracters.add(registry); // this runs last because it is slowest browserExtracters.add(chrome); browserExtracters.add(firefox); diff --git a/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java b/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java index 20a08c9b4f..87e1c59cdf 100644 --- a/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java +++ b/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java @@ -28,7 +28,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.PlatformUtil; import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.autopsy.ingest.IngestModuleAdapter; -import org.sleuthkit.autopsy.ingest.IngestModuleContext; +import org.sleuthkit.autopsy.ingest.IngestJobContext; import org.sleuthkit.autopsy.ingest.IngestServices; import org.sleuthkit.autopsy.ingest.ModuleContentEvent; import org.sleuthkit.autopsy.scalpel.jni.ScalpelOutputParser.CarvedFileMeta; @@ -57,7 +57,7 @@ class ScalpelCarverIngestModule extends IngestModuleAdapter implements FileInges private String configFilePath; private boolean initialized = false; private ScalpelCarver carver; - private IngestModuleContext context; + private IngestJobContext context; ScalpelCarverIngestModule() { } @@ -189,7 +189,7 @@ class ScalpelCarverIngestModule extends IngestModuleAdapter implements FileInges } @Override - public void startUp(IngestModuleContext context) throws Exception { + public void startUp(IngestJobContext context) throws Exception { this.context = context; // make sure this is Windows diff --git a/SevenZip/src/org/sleuthkit/autopsy/sevenzip/SevenZipIngestModule.java b/SevenZip/src/org/sleuthkit/autopsy/sevenzip/SevenZipIngestModule.java index d74931bc60..bb3750ea6b 100644 --- a/SevenZip/src/org/sleuthkit/autopsy/sevenzip/SevenZipIngestModule.java +++ b/SevenZip/src/org/sleuthkit/autopsy/sevenzip/SevenZipIngestModule.java @@ -56,7 +56,7 @@ import org.sleuthkit.datamodel.ReadContentInputStream; import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskData; import org.sleuthkit.autopsy.ingest.IngestModule.ResultCode; -import org.sleuthkit.autopsy.ingest.IngestModuleContext; +import org.sleuthkit.autopsy.ingest.IngestJobContext; /** * 7Zip ingest module Extracts supported archives, adds extracted DerivedFiles, @@ -85,13 +85,13 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F private static final int readHeaderSize = 4; private final byte[] fileHeaderBuffer = new byte[readHeaderSize]; private static final int ZIP_SIGNATURE_BE = 0x504B0304; - private IngestModuleContext context; + private IngestJobContext context; SevenZipIngestModule() { } @Override - public void startUp(IngestModuleContext context) throws Exception{ + public void startUp(IngestJobContext context) throws Exception{ this.context = context; unpackDir = context.getOutputDirectoryRelativePath(); unpackDirPath = context.getOutputDirectoryAbsolutePath(); diff --git a/ewfVerify/src/org/sleuthkit/autopsy/ewfverify/EwfVerifierModuleFactory.java b/ewfVerify/src/org/sleuthkit/autopsy/ewfverify/EwfVerifierModuleFactory.java index c46395221e..6c2ac8ac11 100755 --- a/ewfVerify/src/org/sleuthkit/autopsy/ewfverify/EwfVerifierModuleFactory.java +++ b/ewfVerify/src/org/sleuthkit/autopsy/ewfverify/EwfVerifierModuleFactory.java @@ -37,7 +37,7 @@ public class EwfVerifierModuleFactory extends IngestModuleFactoryAdapter { } static String getModuleName() { - return "EWF Verify"; // RJCTODO: Is this what we want here? Also, this class is not in pipeline config + return "EWF Verifier"; } @Override diff --git a/ewfVerify/src/org/sleuthkit/autopsy/ewfverify/EwfVerifyIngestModule.java b/ewfVerify/src/org/sleuthkit/autopsy/ewfverify/EwfVerifyIngestModule.java index 7f1d11a8c6..807c09fbae 100755 --- a/ewfVerify/src/org/sleuthkit/autopsy/ewfverify/EwfVerifyIngestModule.java +++ b/ewfVerify/src/org/sleuthkit/autopsy/ewfverify/EwfVerifyIngestModule.java @@ -34,7 +34,7 @@ import org.sleuthkit.datamodel.Image; import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskData; import org.sleuthkit.autopsy.ingest.DataSourceIngestModule; -import org.sleuthkit.autopsy.ingest.IngestModuleContext; +import org.sleuthkit.autopsy.ingest.IngestJobContext; /** * Data source ingest module that verifies the integrity of an Expert Witness @@ -45,11 +45,11 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo private static final Logger logger = Logger.getLogger(EwfVerifyIngestModule.class.getName()); private static final long DEFAULT_CHUNK_SIZE = 32 * 1024; private static final IngestServices services = IngestServices.getDefault(); - private IngestModuleContext context; + private IngestJobContext context; private Image img; private String imgName; private MessageDigest messageDigest; - private static int messageId = 0; // RJCTODO: Copy-paste synchronized implementation, put in sample also + private static int messageId = 0; // RJCTODO: Not thread safe private boolean verified = false; private boolean skipped = false; private String calculatedHash = ""; @@ -59,7 +59,7 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo } @Override - public void startUp(IngestModuleContext context) throws Exception { + public void startUp(IngestJobContext context) throws Exception { this.context = context; verified = false; skipped = false; @@ -140,7 +140,7 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo // Read in byte size chunks and update the hash value with the data. for (int i = 0; i < totalChunks; i++) { if (statusHelper.isCancelled()) { - return ResultCode.OK; // RJCTODO: Use unknown? + return ResultCode.OK; } data = new byte[ (int) chunkSize ]; try { diff --git a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java index 6448e3d895..8f96142fe0 100644 --- a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java +++ b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java @@ -31,7 +31,7 @@ import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.autopsy.ingest.IngestMessage; import org.sleuthkit.autopsy.ingest.IngestModule.ResultCode; import org.sleuthkit.autopsy.ingest.IngestModuleAdapter; -import org.sleuthkit.autopsy.ingest.IngestModuleContext; +import org.sleuthkit.autopsy.ingest.IngestJobContext; import org.sleuthkit.autopsy.ingest.IngestServices; import org.sleuthkit.autopsy.ingest.ModuleContentEvent; import org.sleuthkit.autopsy.ingest.ModuleDataEvent; @@ -52,10 +52,9 @@ public final class ThunderbirdMboxFileIngestModule extends IngestModuleAdapter i private static final Logger logger = Logger.getLogger(ThunderbirdMboxFileIngestModule.class.getName()); private IngestServices services; - private final String hashDBModuleName = "Hash Lookup"; private int messageId = 0; // RJCTODO: Not thread safe private FileManager fileManager; - private IngestModuleContext context; + private IngestJobContext context; ThunderbirdMboxFileIngestModule() { } @@ -248,7 +247,7 @@ public final class ThunderbirdMboxFileIngestModule extends IngestModuleAdapter i } @Override - public void startUp(IngestModuleContext context) throws Exception { + public void startUp(IngestJobContext context) throws Exception { this.context = context; services = IngestServices.getDefault(); fileManager = Case.getCurrentCase().getServices().getFileManager();