Prepare for merge of develop branch

This commit is contained in:
Richard Cordovano 2014-03-18 15:33:38 -04:00
parent 03e2f5fb6c
commit bed31e5f8f
54 changed files with 348 additions and 473 deletions

View File

@ -19,7 +19,7 @@
package org.sleuthkit.autopsy.casemodule; package org.sleuthkit.autopsy.casemodule;
import org.sleuthkit.autopsy.ingest.IngestConfigurator; import org.sleuthkit.autopsy.ingest.IngestJobLauncher;
import java.awt.Component; import java.awt.Component;
import java.awt.Dialog; import java.awt.Dialog;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -36,12 +36,12 @@ import org.openide.DialogDisplayer;
import org.openide.WizardDescriptor; import org.openide.WizardDescriptor;
import org.openide.util.ChangeSupport; import org.openide.util.ChangeSupport;
import org.openide.util.HelpCtx; import org.openide.util.HelpCtx;
import org.openide.util.Lookup;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.openide.util.actions.CallableSystemAction; import org.openide.util.actions.CallableSystemAction;
import org.openide.util.actions.Presenter; import org.openide.util.actions.Presenter;
import org.openide.util.lookup.ServiceProvider; import org.openide.util.lookup.ServiceProvider;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.datamodel.Image; import org.sleuthkit.datamodel.Image;
/** /**
@ -109,8 +109,7 @@ public final class AddImageAction extends CallableSystemAction implements Presen
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
Logger.noteAction(AddImageAction.class); Logger.noteAction(AddImageAction.class);
final IngestConfigurator ingestConfig = Lookup.getDefault().lookup(IngestConfigurator.class); if (IngestManager.getDefault().isIngestRunning()) {
if (null != ingestConfig && ingestConfig.isIngestRunning()) {
final String msg = "<html>Ingest is ongoing on another data source. Adding a new source now might slow down the current ingest.<br />Do you want to proceed and add a new data source now?</html>"; final String msg = "<html>Ingest is ongoing on another data source. Adding a new source now might slow down the current ingest.<br />Do you want to proceed and add a new data source now?</html>";
if (JOptionPane.showConfirmDialog(null, msg, "Ingest in progress", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.NO_OPTION) { if (JOptionPane.showConfirmDialog(null, msg, "Ingest in progress", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.NO_OPTION) {
return; return;

View File

@ -19,7 +19,7 @@
package org.sleuthkit.autopsy.casemodule; package org.sleuthkit.autopsy.casemodule;
import org.sleuthkit.autopsy.ingest.IngestConfigurator; import org.sleuthkit.autopsy.ingest.IngestJobLauncher;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Window; import java.awt.Window;
@ -46,7 +46,7 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor;
class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDescriptor> { class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDescriptor> {
private static final Logger logger = Logger.getLogger(AddImageWizardIngestConfigPanel.class.getName()); 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 * The visual component that displays this panel. If you need to access the
* component from this class, just use getComponent(). * component from this class, just use getComponent().
@ -73,8 +73,8 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
this.progressPanel = proPanel; this.progressPanel = proPanel;
this.dataSourcePanel = dsPanel; this.dataSourcePanel = dsPanel;
ingestConfig = new IngestConfigurator(AddImageWizardIngestConfigPanel.class.getCanonicalName()); ingestConfig = new IngestJobLauncher(AddImageWizardIngestConfigPanel.class.getCanonicalName());
List<String> messages = ingestConfig.getMissingIngestModuleErrorMessages(); List<String> messages = ingestConfig.getMissingIngestModuleMessages();
if (messages.isEmpty() == false) { if (messages.isEmpty() == false) {
StringBuilder warning = new StringBuilder(); StringBuilder warning = new StringBuilder();
for (String message : messages) { for (String message : messages) {
@ -95,7 +95,7 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
@Override @Override
public Component getComponent() { public Component getComponent() {
if (component == null) { if (component == null) {
component = new AddImageWizardIngestConfigVisual(ingestConfig.getIngestConfigPanel()); component = new AddImageWizardIngestConfigVisual(ingestConfig.getIngestJobConfigPanel());
} }
return component; return component;
} }
@ -187,7 +187,7 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
*/ */
@Override @Override
public void storeSettings(WizardDescriptor settings) { public void storeSettings(WizardDescriptor settings) {
ingestConfig.save(); ingestConfig.saveIngestJobConfig();
// Start ingest if it hasn't already been started // Start ingest if it hasn't already been started
readyToIngest = true; readyToIngest = true;
@ -201,8 +201,8 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
private void startIngest() { private void startIngest() {
if (!newContents.isEmpty() && readyToIngest && !ingested) { if (!newContents.isEmpty() && readyToIngest && !ingested) {
ingested = true; ingested = true;
ingestConfig.setContent(newContents); ingestConfig.setDataSourcesToIngest(newContents);
ingestConfig.start(); ingestConfig.startIngestJobs();
progressPanel.setStateFinished(); progressPanel.setStateFinished();
} }

View File

@ -113,7 +113,7 @@ class DirectoryTreeFilterNode extends FilterNode {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
final IngestDialog ingestDialog = new IngestDialog(); final IngestDialog ingestDialog = new IngestDialog();
ingestDialog.setContent(Collections.<Content>singletonList(content)); ingestDialog.setDataSources(Collections.<Content>singletonList(content));
ingestDialog.display(); ingestDialog.display();
} }
}); });

View File

@ -44,13 +44,14 @@ import org.sleuthkit.datamodel.FsContent;
import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException; 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 * 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 * IngestModuleAdapter abstract class could have been used as a base class to
* obtain default implementations of many of the DataSourceIngestModule methods. * 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 { class SampleDataSourceIngestModule extends IngestModuleAdapter implements DataSourceIngestModule {
private static final Logger logger = Logger.getLogger(SampleDataSourceIngestModule.class); private static final Logger logger = Logger.getLogger(SampleDataSourceIngestModule.class);
@ -80,18 +81,4 @@ class SampleDataSourceIngestModule extends IngestModuleAdapter implements DataSo
return IngestModule.ResultCode.OK; 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";
// }
} }

View File

@ -1,33 +1,32 @@
/* /*
* Sample module in the public domain. Feel free to use this as a template * Sample module in the public domain. Feel free to use this as a template
* for your modules. * for your modules.
* *
* Contact: Brian Carrier [carrier <at> sleuthkit [dot] org] * Contact: Brian Carrier [carrier <at> sleuthkit [dot] org]
* *
* This is free and unencumbered software released into the public domain. * This is free and unencumbered software released into the public domain.
* *
* Anyone is free to copy, modify, publish, use, compile, sell, or * Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled * distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any * binary, for any purpose, commercial or non-commercial, and by any
* means. * means.
* *
* In jurisdictions that recognize copyright laws, the author or authors * In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the * of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit * 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 * of the public at large and to the detriment of our heirs and
* successors. We intend this dedication to be an overt act of * successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this * relinquishment in perpetuity of all present and future rights to this
* software under copyright law. * software under copyright law.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * 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 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE. * OTHER DEALINGS IN THE SOFTWARE.
*/ */
package org.sleuthkit.autopsy.examples; package org.sleuthkit.autopsy.examples;
import org.apache.log4j.Logger; 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.FileIngestModule;
import org.sleuthkit.autopsy.ingest.IngestModule; import org.sleuthkit.autopsy.ingest.IngestModule;
import org.sleuthkit.autopsy.ingest.IngestModuleAdapter; 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.AbstractFile;
import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.BlackboardAttribute;
@ -44,23 +43,26 @@ import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskData; 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 * 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. * that it will get called on each file in the disk image / logical file set. It
* It does a stupid calculation of the number of null bytes in the beginning of the * does a stupid calculation of the number of null bytes in the beginning of the
* file in order to show the basic flow. * file in order to show the basic flow.
* *
* Autopsy has been hard coded to ignore this module based on the it's package name. * Autopsy has been hard coded to ignore this module based on the it's package
* IngestModuleLoader will not load things from the org.sleuthkit.autopsy.examples package. * name. IngestModuleLoader will not load things from the
* Either change the package or the loading code to make this module actually run. * 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 { class SampleFileIngestModule extends IngestModuleAdapter implements FileIngestModule {
private int attrId = -1; private int attrId = -1;
@Override @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 /* 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 * results to the blackbaord with. There are many standard blackboard artifact
* and attribute types and you should first consider using one of those before * and attribute types and you should first consider using one of those before
@ -89,8 +91,8 @@ class SampleFileIngestModule extends IngestModuleAdapter implements FileIngestMo
@Override @Override
public IngestModule.ResultCode process(AbstractFile abstractFile) { public IngestModule.ResultCode process(AbstractFile abstractFile) {
// skip non-files // skip non-files
if ((abstractFile.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS) || if ((abstractFile.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)
(abstractFile.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS)) { || (abstractFile.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS)) {
return IngestModule.ResultCode.OK; return IngestModule.ResultCode.OK;
} }
@ -133,20 +135,4 @@ class SampleFileIngestModule extends IngestModuleAdapter implements FileIngestMo
} }
// RJCTODO: Add a module factory // 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";
// }
} }

View File

@ -31,6 +31,6 @@ IngestMessagePanel.totalMessagesNameLabel.text=Total:
IngestMessagePanel.totalMessagesNameVal.text=- IngestMessagePanel.totalMessagesNameVal.text=-
IngestMessagePanel.totalUniqueMessagesNameLabel.text=Unique: IngestMessagePanel.totalUniqueMessagesNameLabel.text=Unique:
IngestMessagePanel.totalUniqueMessagesNameVal.text=- IngestMessagePanel.totalUniqueMessagesNameVal.text=-
IngestConfigurationPanel.advancedButton.text=Advanced IngestJobConfigurationPanel.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.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
IngestConfigurationPanel.processUnallocCheckbox.text=Process Unallocated Space IngestJobConfigurationPanel.advancedButton.text=Advanced

View File

@ -35,54 +35,55 @@ import org.sleuthkit.datamodel.VolumeSystem;
/** /**
* Abstract visitor for getting all the files from content. * Abstract visitor for getting all the files from content.
*/ */
// TODO Could be moved to utility package, is there another version of this // RJCTODO: Could this be moved to utility package, is there another version of this
// somewhere? // somewhere? An old comment said something about circular dependencies. Note: will use
abstract class GetFilesContentVisitor implements ContentVisitor<Collection<AbstractFile>> { // this for per ingest job progress bars.
abstract class GetFilesContentVisitor implements ContentVisitor<Collection<AbstractFile>> {
private static final Logger logger = Logger.getLogger(GetFilesContentVisitor.class.getName()); private static final Logger logger = Logger.getLogger(GetFilesContentVisitor.class.getName());
@Override @Override
public Collection<AbstractFile> visit(VirtualDirectory ld) { public Collection<AbstractFile> visit(VirtualDirectory ld) {
return getAllFromChildren(ld); return getAllFromChildren(ld);
} }
@Override @Override
public Collection<AbstractFile> visit(Directory drctr) { public Collection<AbstractFile> visit(Directory drctr) {
return getAllFromChildren(drctr); return getAllFromChildren(drctr);
} }
@Override @Override
public Collection<AbstractFile> visit(Image image) { public Collection<AbstractFile> visit(Image image) {
return getAllFromChildren(image); return getAllFromChildren(image);
} }
@Override @Override
public Collection<AbstractFile> visit(Volume volume) { public Collection<AbstractFile> visit(Volume volume) {
return getAllFromChildren(volume); return getAllFromChildren(volume);
} }
@Override @Override
public Collection<AbstractFile> visit(VolumeSystem vs) { public Collection<AbstractFile> visit(VolumeSystem vs) {
return getAllFromChildren(vs); return getAllFromChildren(vs);
} }
/** /**
* Aggregate all the matches from visiting the children Content objects of the * Aggregate all the matches from visiting the children Content objects of the
* one passed * one passed
* @param parent * @param parent
* @return * @return
*/ */
protected Collection<AbstractFile> getAllFromChildren(Content parent) { protected Collection<AbstractFile> getAllFromChildren(Content parent) {
Collection<AbstractFile> all = new ArrayList<>(); Collection<AbstractFile> all = new ArrayList<>();
try { try {
for (Content child : parent.getChildren()) { for (Content child : parent.getChildren()) {
all.addAll(child.accept(this)); all.addAll(child.accept(this));
} }
} catch (TskException ex) { } catch (TskException ex) {
logger.log(Level.SEVERE, "Error getting Content children", ex); logger.log(Level.SEVERE, "Error getting Content children", ex);
} }
return all; return all;
} }
} }

View File

@ -34,21 +34,21 @@ import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import org.sleuthkit.datamodel.Content; 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. * 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 final String TITLE = "Ingest Modules";
private static Dimension DIMENSIONS = new Dimension(500, 300); private static Dimension DIMENSIONS = new Dimension(500, 300);
private IngestConfigurator ingestConfigurator; private IngestJobLauncher ingestConfigurator;
public IngestDialog(JFrame frame, String title, boolean modal) { public IngestDialog(JFrame frame, String title, boolean modal) {
super(frame, title, modal); super(frame, title, modal);
ingestConfigurator = new IngestConfigurator(IngestDialog.class.getCanonicalName()); ingestConfigurator = new IngestJobLauncher(IngestDialog.class.getCanonicalName());
List<String> messages = ingestConfigurator.getMissingIngestModuleErrorMessages(); List<String> messages = ingestConfigurator.getMissingIngestModuleMessages();
if (messages.isEmpty() == false) { if (messages.isEmpty() == false) {
StringBuilder warning = new StringBuilder(); StringBuilder warning = new StringBuilder();
for (String message : messages) { 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 // set the location of the popUp Window on the center of the screen
setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2); 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 startButton = new JButton("Start");
JButton closeButton = new JButton("Close"); JButton closeButton = new JButton("Close");
startButton.addActionListener(new ActionListener() { startButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
ingestConfigurator.save(); ingestConfigurator.saveIngestJobConfig();
ingestConfigurator.start(); ingestConfigurator.startIngestJobs();
close(); close();
} }
}); });
@ -93,7 +93,7 @@ public class IngestDialog extends JDialog {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
ingestConfigurator.save(); ingestConfigurator.saveIngestJobConfig();
close(); close();
} }
}); });
@ -101,7 +101,7 @@ public class IngestDialog extends JDialog {
@Override @Override
public void windowClosing(WindowEvent e) { public void windowClosing(WindowEvent e) {
ingestConfigurator.save(); ingestConfigurator.saveIngestJobConfig();
close(); close();
} }
}); });
@ -118,8 +118,8 @@ public class IngestDialog extends JDialog {
setVisible(true); setVisible(true);
} }
public void setContent(List<Content> inputContent) { public void setDataSources(List<Content> inputContent) {
ingestConfigurator.setContent(inputContent); ingestConfigurator.setDataSourcesToIngest(inputContent);
} }
/** /**

View File

@ -33,7 +33,7 @@ import org.sleuthkit.datamodel.Content;
* Encapsulates a data source and the ingest module pipelines to be used to * Encapsulates a data source and the ingest module pipelines to be used to
* ingest the data source. * ingest the data source.
*/ */
final class DataSourceIngestTask { final class IngestJob {
private final long id; private final long id;
private final Content dataSource; private final Content dataSource;
@ -45,7 +45,7 @@ final class DataSourceIngestTask {
private DataSourceIngestPipeline initialDataSourceIngestPipeline = null; private DataSourceIngestPipeline initialDataSourceIngestPipeline = null;
private boolean cancelled; private boolean cancelled;
DataSourceIngestTask(long id, Content dataSource, List<IngestModuleTemplate> ingestModuleTemplates, boolean processUnallocatedSpace) { IngestJob(long id, Content dataSource, List<IngestModuleTemplate> ingestModuleTemplates, boolean processUnallocatedSpace) {
this.id = id; this.id = id;
this.dataSource = dataSource; this.dataSource = dataSource;
this.ingestModuleTemplates = ingestModuleTemplates; this.ingestModuleTemplates = ingestModuleTemplates;
@ -92,7 +92,7 @@ final class DataSourceIngestTask {
dataSourceIngestPipelines.put(threadId, pipeline); dataSourceIngestPipelines.put(threadId, pipeline);
} else if (!dataSourceIngestPipelines.containsKey(threadId)) { } else if (!dataSourceIngestPipelines.containsKey(threadId)) {
pipeline = new DataSourceIngestPipeline(this, ingestModuleTemplates); 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); dataSourceIngestPipelines.put(threadId, pipeline);
} else { } else {
pipeline = dataSourceIngestPipelines.get(threadId); pipeline = dataSourceIngestPipelines.get(threadId);
@ -146,11 +146,11 @@ final class DataSourceIngestTask {
static final class DataSourceIngestPipeline { static final class DataSourceIngestPipeline {
private static final Logger logger = Logger.getLogger(DataSourceIngestPipeline.class.getName()); private static final Logger logger = Logger.getLogger(DataSourceIngestPipeline.class.getName());
private final DataSourceIngestTask task; private final IngestJob task;
private final List<IngestModuleTemplate> moduleTemplates; private final List<IngestModuleTemplate> moduleTemplates;
private List<DataSourceIngestModuleDecorator> modules = new ArrayList<>(); private List<DataSourceIngestModuleDecorator> modules = new ArrayList<>();
private DataSourceIngestPipeline(DataSourceIngestTask task, List<IngestModuleTemplate> moduleTemplates) { private DataSourceIngestPipeline(IngestJob task, List<IngestModuleTemplate> moduleTemplates) {
this.task = task; this.task = task;
this.moduleTemplates = moduleTemplates; this.moduleTemplates = moduleTemplates;
} }
@ -169,7 +169,7 @@ final class DataSourceIngestTask {
if (factory.isDataSourceIngestModuleFactory()) { if (factory.isDataSourceIngestModuleFactory()) {
IngestModuleSettings ingestOptions = template.getIngestOptions(); IngestModuleSettings ingestOptions = template.getIngestOptions();
DataSourceIngestModuleDecorator module = new DataSourceIngestModuleDecorator(factory.createDataSourceIngestModule(ingestOptions), factory.getModuleDisplayName()); DataSourceIngestModuleDecorator module = new DataSourceIngestModuleDecorator(factory.createDataSourceIngestModule(ingestOptions), factory.getModuleDisplayName());
IngestModuleContext context = new IngestModuleContext(task, factory); IngestJobContext context = new IngestJobContext(task, factory);
try { try {
module.startUp(context); module.startUp(context);
modulesByClass.put(module.getClassName(), module); modulesByClass.put(module.getClassName(), module);
@ -250,7 +250,7 @@ final class DataSourceIngestTask {
} }
@Override @Override
public void startUp(IngestModuleContext context) throws Exception { public void startUp(IngestJobContext context) throws Exception {
module.startUp(context); module.startUp(context);
} }
@ -273,11 +273,11 @@ final class DataSourceIngestTask {
static final class FileIngestPipeline { static final class FileIngestPipeline {
private static final Logger logger = Logger.getLogger(FileIngestPipeline.class.getName()); private static final Logger logger = Logger.getLogger(FileIngestPipeline.class.getName());
private final DataSourceIngestTask task; private final IngestJob task;
private final List<IngestModuleTemplate> moduleTemplates; private final List<IngestModuleTemplate> moduleTemplates;
private List<FileIngestModuleDecorator> modules = new ArrayList<>(); private List<FileIngestModuleDecorator> modules = new ArrayList<>();
private FileIngestPipeline(DataSourceIngestTask task, List<IngestModuleTemplate> moduleTemplates) { private FileIngestPipeline(IngestJob task, List<IngestModuleTemplate> moduleTemplates) {
this.task = task; this.task = task;
this.moduleTemplates = moduleTemplates; this.moduleTemplates = moduleTemplates;
} }
@ -296,7 +296,7 @@ final class DataSourceIngestTask {
if (factory.isFileIngestModuleFactory()) { if (factory.isFileIngestModuleFactory()) {
IngestModuleSettings ingestOptions = template.getIngestOptions(); IngestModuleSettings ingestOptions = template.getIngestOptions();
FileIngestModuleDecorator module = new FileIngestModuleDecorator(factory.createFileIngestModule(ingestOptions), factory.getModuleDisplayName()); FileIngestModuleDecorator module = new FileIngestModuleDecorator(factory.createFileIngestModule(ingestOptions), factory.getModuleDisplayName());
IngestModuleContext context = new IngestModuleContext(task, factory); IngestJobContext context = new IngestJobContext(task, factory);
try { try {
module.startUp(context); module.startUp(context);
modulesByClass.put(module.getClassName(), module); modulesByClass.put(module.getClassName(), module);
@ -376,7 +376,7 @@ final class DataSourceIngestTask {
} }
@Override @Override
public void startUp(IngestModuleContext context) throws Exception { public void startUp(IngestJobContext context) throws Exception {
module.startUp(context); module.startUp(context);
} }

View File

@ -134,7 +134,7 @@
<Component class="javax.swing.JButton" name="advancedButton"> <Component class="javax.swing.JButton" name="advancedButton">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestConfigurationPanel.advancedButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestJobConfigurationPanel.advancedButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
<Property name="enabled" type="boolean" value="false"/> <Property name="enabled" type="boolean" value="false"/>
</Properties> </Properties>
@ -201,10 +201,10 @@
<Component class="javax.swing.JCheckBox" name="processUnallocCheckbox"> <Component class="javax.swing.JCheckBox" name="processUnallocCheckbox">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestConfigurationPanel.processUnallocCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestJobConfigurationPanel.processUnallocCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestConfigurationPanel.processUnallocCheckbox.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestJobConfigurationPanel.processUnallocCheckbox.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
<Events> <Events>

View File

@ -38,13 +38,13 @@ import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog;
* User interface component to allow a user to set ingest module options and * User interface component to allow a user to set ingest module options and
* enable/disable the modules. * enable/disable the modules.
*/ */
class IngestConfigurationPanel extends javax.swing.JPanel { class IngestJobConfigurationPanel extends javax.swing.JPanel {
private List<IngestModuleModel> modules = new ArrayList<>(); private List<IngestModuleModel> modules = new ArrayList<>();
private boolean processUnallocatedSpace = false; private boolean processUnallocatedSpace = false;
private IngestModuleModel selectedModule = null; private IngestModuleModel selectedModule = null;
IngestConfigurationPanel(List<IngestModuleTemplate> moduleTemplates, boolean processUnallocatedSpace) { IngestJobConfigurationPanel(List<IngestModuleTemplate> moduleTemplates, boolean processUnallocatedSpace) {
for (IngestModuleTemplate moduleTemplate : moduleTemplates) { for (IngestModuleTemplate moduleTemplate : moduleTemplates) {
modules.add(new IngestModuleModel(moduleTemplate)); 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.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(160, 160, 160)));
jPanel1.setPreferredSize(new java.awt.Dimension(338, 257)); 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.setEnabled(false);
advancedButton.addActionListener(new java.awt.event.ActionListener() { advancedButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) { 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))); 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.setText(org.openide.util.NbBundle.getMessage(IngestJobConfigurationPanel.class, "IngestJobConfigurationPanel.processUnallocCheckbox.text")); // NOI18N
processUnallocCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(IngestConfigurationPanel.class, "IngestConfigurationPanel.processUnallocCheckbox.toolTipText")); // NOI18N processUnallocCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(IngestJobConfigurationPanel.class, "IngestJobConfigurationPanel.processUnallocCheckbox.toolTipText")); // NOI18N
processUnallocCheckbox.addActionListener(new java.awt.event.ActionListener() { processUnallocCheckbox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) { public void actionPerformed(java.awt.event.ActionEvent evt) {
processUnallocCheckboxActionPerformed(evt); processUnallocCheckboxActionPerformed(evt);
@ -295,18 +295,18 @@ class IngestConfigurationPanel extends javax.swing.JPanel {
private final IngestModuleTemplate moduleTemplate; private final IngestModuleTemplate moduleTemplate;
private IngestModuleGlobalSetttingsPanel resourcesConfigPanel = null; private IngestModuleGlobalSetttingsPanel resourcesConfigPanel = null;
private IngestModuleSettingsPanel ingestJobOptionsPanel = null; private IngestModuleJobSettingsPanel ingestJobOptionsPanel = null;
IngestModuleModel(IngestModuleTemplate moduleTemplate) { IngestModuleModel(IngestModuleTemplate moduleTemplate) {
this.moduleTemplate = moduleTemplate; this.moduleTemplate = moduleTemplate;
IngestModuleFactory moduleFactory = moduleTemplate.getIngestModuleFactory(); IngestModuleFactory moduleFactory = moduleTemplate.getIngestModuleFactory();
if (moduleFactory.providesIngestJobOptionsPanels()) { if (moduleFactory.providesModuleSettingsPanel()) {
ingestJobOptionsPanel = moduleFactory.getIngestJobOptionsPanel(moduleTemplate.getIngestOptions()); ingestJobOptionsPanel = moduleFactory.getModuleSettingsPanel(moduleTemplate.getIngestOptions());
} }
if (moduleFactory.providesResourcesConfigPanels()) { if (moduleFactory.providesGlobalSettingsPanel()) {
resourcesConfigPanel = moduleFactory.getResourcesConfigPanel(); resourcesConfigPanel = moduleFactory.getGlobalSettingsPanel();
} }
} }
@ -331,15 +331,15 @@ class IngestConfigurationPanel extends javax.swing.JPanel {
} }
boolean hasIngestOptionsPanel() { boolean hasIngestOptionsPanel() {
return moduleTemplate.getIngestModuleFactory().providesIngestJobOptionsPanels(); return moduleTemplate.getIngestModuleFactory().providesModuleSettingsPanel();
} }
IngestModuleSettingsPanel getIngestOptionsPanel() { IngestModuleJobSettingsPanel getIngestOptionsPanel() {
return ingestJobOptionsPanel; return ingestJobOptionsPanel;
} }
boolean hasResourcesConfigPanel() { boolean hasResourcesConfigPanel() {
return moduleTemplate.getIngestModuleFactory().providesResourcesConfigPanels(); return moduleTemplate.getIngestModuleFactory().providesGlobalSettingsPanel();
} }
IngestModuleGlobalSetttingsPanel getResourcesConfigPanel() { IngestModuleGlobalSetttingsPanel getResourcesConfigPanel() {

View File

@ -32,16 +32,16 @@ import org.sleuthkit.datamodel.SleuthkitCase;
* Acts as a facade for the parts of the ingest framework that make up the * Acts as a facade for the parts of the ingest framework that make up the
* processing context of an ingest module. * 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 IngestModuleFactory moduleFactory;
private final IngestManager ingestManager; private final IngestManager ingestManager;
private final IngestScheduler scheduler; private final IngestScheduler scheduler;
private final Case autopsyCase; private final Case autopsyCase;
private final SleuthkitCase sleuthkitCase; private final SleuthkitCase sleuthkitCase;
IngestModuleContext(DataSourceIngestTask ingestJob, IngestModuleFactory moduleFactory) { IngestJobContext(IngestJob ingestJob, IngestModuleFactory moduleFactory) {
this.ingestJob = ingestJob; this.ingestJob = ingestJob;
this.moduleFactory = moduleFactory; this.moduleFactory = moduleFactory;
ingestManager = IngestManager.getDefault(); ingestManager = IngestManager.getDefault();
@ -54,20 +54,10 @@ public final class IngestModuleContext {
return this.ingestJob.isCancelled(); return this.ingestJob.isCancelled();
} }
/**
* RJCTODO
*
* @return
*/
public Case getCase() { public Case getCase() {
return autopsyCase; return autopsyCase;
} }
/**
* RJCTODO
*
* @return
*/
public SleuthkitCase getSleuthkitCase() { public SleuthkitCase getSleuthkitCase() {
return sleuthkitCase; return sleuthkitCase;
} }

View File

@ -25,33 +25,22 @@ import javax.swing.JPanel;
import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.autopsy.coreutils.ModuleSettings;
import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Content;
/** public final class IngestJobLauncher {
* 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 {
private static final String ENABLED_INGEST_MODULES_KEY = "Enabled_Ingest_Modules"; 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 DISABLED_INGEST_MODULES_KEY = "Disabled_Ingest_Modules";
private static final String PARSE_UNALLOC_SPACE_KEY = "Process_Unallocated_Space"; private static final String PARSE_UNALLOC_SPACE_KEY = "Process_Unallocated_Space";
private final String context; private final String launcherContext;
private List<String> missingIngestModuleErrorMessages = new ArrayList<>(); private final List<String> missingIngestModuleErrorMessages = new ArrayList<>();
private IngestConfigurationPanel ingestConfigPanel = null; private final List<Content> dataSourcesToIngest = new ArrayList<>();
private List<Content> contentToIngest = null; // RJCTODO: Remove if start() method removed private IngestJobConfigurationPanel ingestConfigPanel;
/** public IngestJobLauncher(String launcherContext) {
* RJCTODO this.launcherContext = launcherContext;
*
* @param context
*/
public IngestConfigurator(String context) {
this.context = context;
// Get the ingest module factories discovered by the ingest module // Get the ingest module factories discovered by the ingest module
// loader. // 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<IngestModuleFactory> moduleFactories = IngestModuleLoader.getInstance().getIngestModuleFactories(); List<IngestModuleFactory> moduleFactories = IngestModuleLoader.getInstance().getIngestModuleFactories();
HashSet<String> loadedModuleNames = new HashSet<>(); HashSet<String> loadedModuleNames = new HashSet<>();
for (IngestModuleFactory moduleFactory : moduleFactories) { for (IngestModuleFactory moduleFactory : moduleFactories) {
@ -67,10 +56,11 @@ public class IngestConfigurator {
HashSet<String> knownModuleNames = new HashSet<>(); HashSet<String> knownModuleNames = new HashSet<>();
List<IngestModuleTemplate> moduleTemplates = new ArrayList<>(); List<IngestModuleTemplate> moduleTemplates = new ArrayList<>();
for (IngestModuleFactory moduleFactory : moduleFactories) { 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 // NOTE: In the future, this code will be modified to get the
// resources configuration and ingest job options for each module // resources configuration and ingest job options for each module
// for the current context; for now just get the defaults. // for the current context; for now just get the defaults.
IngestModuleSettings ingestOptions = moduleFactory.getDefaultIngestJobOptions(); IngestModuleSettings ingestOptions = moduleFactory.getDefaultModuleSettings();
IngestModuleTemplate moduleTemplate = new IngestModuleTemplate(moduleFactory, ingestOptions); IngestModuleTemplate moduleTemplate = new IngestModuleTemplate(moduleFactory, ingestOptions);
String moduleName = moduleTemplate.getIngestModuleFactory().getModuleDisplayName(); String moduleName = moduleTemplate.getIngestModuleFactory().getModuleDisplayName();
if (enabledModuleNames.contains(moduleName)) { if (enabledModuleNames.contains(moduleName)) {
@ -94,48 +84,32 @@ public class IngestConfigurator {
if (!knownModuleNames.contains(moduleName)) { if (!knownModuleNames.contains(moduleName)) {
missingIngestModuleErrorMessages.add(moduleName + " was previously enabled, but could not be found"); missingIngestModuleErrorMessages.add(moduleName + " was previously enabled, but could not be found");
enabledModuleNames.remove(moduleName); 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(launcherContext, ENABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(enabledModuleNames));
ModuleSettings.setConfigSetting(context, DISABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(disabledModuleNames)); ModuleSettings.setConfigSetting(launcherContext, DISABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(disabledModuleNames));
// Get the process unallocated space flag setting. If the setting does // Get the process unallocated space flag setting. If the setting does
// not exist yet, default it to false. // not exist yet, default it to false.
if (ModuleSettings.settingExists(context, PARSE_UNALLOC_SPACE_KEY) == false) { if (ModuleSettings.settingExists(launcherContext, PARSE_UNALLOC_SPACE_KEY) == false) {
ModuleSettings.setConfigSetting(context, 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). // Make the configuration panel for the current context (view).
ingestConfigPanel = new IngestConfigurationPanel(moduleTemplates, processUnallocatedSpace); ingestConfigPanel = new IngestJobConfigurationPanel(moduleTemplates, processUnallocatedSpace);
} }
/** public List<String> getMissingIngestModuleMessages() {
* RJCTODO
*
* @return
*/
public List<String> getMissingIngestModuleErrorMessages() {
return missingIngestModuleErrorMessages; return missingIngestModuleErrorMessages;
} }
/** public JPanel getIngestJobConfigPanel() {
* RJCTODO
*
* @return
*/
public JPanel getIngestConfigPanel() {
return ingestConfigPanel; return ingestConfigPanel;
} }
/** public void saveIngestJobConfig() {
* RJCTODO
*
* @throws
* org.sleuthkit.autopsy.ingest.IngestConfigurator.IngestConfigurationException
*/
public void save() {
List<IngestModuleTemplate> moduleTemplates = ingestConfigPanel.getIngestModuleTemplates(); List<IngestModuleTemplate> moduleTemplates = ingestConfigPanel.getIngestModuleTemplates();
// Save the enabled/disabled ingest module settings for the current context. // Save the enabled/disabled ingest module settings for the current context.
@ -149,31 +123,24 @@ public class IngestConfigurator {
disabledModuleNames.add(moduleName); disabledModuleNames.add(moduleName);
} }
} }
ModuleSettings.setConfigSetting(context, ENABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(enabledModuleNames)); ModuleSettings.setConfigSetting(launcherContext, ENABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(enabledModuleNames));
ModuleSettings.setConfigSetting(context, DISABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(disabledModuleNames)); ModuleSettings.setConfigSetting(launcherContext, DISABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(disabledModuleNames));
// Save the process unallocated space setting for the current context. // Save the process unallocated space setting for the current context.
String processUnalloc = Boolean.toString(ingestConfigPanel.getProcessUnallocSpace()); 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 // 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 public void setDataSourcesToIngest(List<Content> dataSourcesToIngest) {
// starting and running the ingest - probably need to do this anyway, at this.dataSourcesToIngest.clear();
// least if the IngestConfigurator interface goes away and this becomes the this.dataSourcesToIngest.addAll(dataSourcesToIngest);
// IngestConfigurator class.
public void setContent(List<Content> inputContent) {
this.contentToIngest = inputContent;
} }
// RJCTODO: If time permits, make it so that this class is not responsible public void startIngestJobs() {
// starting and running the ingest - probably need to do this anyway, at // Filter out the disabled ingest module templates.
// least if the IngestConfigurator interface goes away and this becomes the
// IngestConfigurator class.
public void start() {
// Filter out the disabled module tremplates.
List<IngestModuleTemplate> enabledModuleTemplates = new ArrayList<>(); List<IngestModuleTemplate> enabledModuleTemplates = new ArrayList<>();
List<IngestModuleTemplate> moduleTemplates = ingestConfigPanel.getIngestModuleTemplates(); List<IngestModuleTemplate> moduleTemplates = ingestConfigPanel.getIngestModuleTemplates();
for (IngestModuleTemplate moduleTemplate : moduleTemplates) { for (IngestModuleTemplate moduleTemplate : moduleTemplates) {
@ -182,19 +149,11 @@ public class IngestConfigurator {
} }
} }
if ((!enabledModuleTemplates.isEmpty()) && (contentToIngest != null)) { if ((!enabledModuleTemplates.isEmpty()) && (dataSourcesToIngest != null)) {
IngestManager.getDefault().scheduleDataSourceTasks(contentToIngest, enabledModuleTemplates, ingestConfigPanel.getProcessUnallocSpace()); 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<String> input) { private static String makeCommaSeparatedList(HashSet<String> input) {
if (input == null || input.isEmpty()) { if (input == null || input.isEmpty()) {
return ""; return "";
@ -210,15 +169,14 @@ public class IngestConfigurator {
return csvList.toString(); return csvList.toString();
} }
// RJCTODO: May need additional mappings - EWF Verify to EWF Verifier
private HashSet<String> getModulesNamesFromSetting(String key, String defaultSetting) { private HashSet<String> getModulesNamesFromSetting(String key, String defaultSetting) {
// Get the ingest modules setting from the user's config file. // Get the ingest modules setting from the user's config file.
// If there is no such setting yet, create the default setting. // If there is no such setting yet, create the default setting.
if (ModuleSettings.settingExists(context, key) == false) { if (ModuleSettings.settingExists(launcherContext, key) == false) {
ModuleSettings.setConfigSetting(context, key, defaultSetting); ModuleSettings.setConfigSetting(launcherContext, key, defaultSetting);
} }
HashSet<String> moduleNames = new HashSet<>(); HashSet<String> moduleNames = new HashSet<>();
String modulesSetting = ModuleSettings.getConfigSetting(context, key); String modulesSetting = ModuleSettings.getConfigSetting(launcherContext, key);
if (!modulesSetting.isEmpty()) { if (!modulesSetting.isEmpty()) {
String[] settingNames = modulesSetting.split(", "); String[] settingNames = modulesSetting.split(", ");
for (String name : settingNames) { for (String name : settingNames) {
@ -231,6 +189,9 @@ public class IngestConfigurator {
case "File Extension Mismatch Detection": case "File Extension Mismatch Detection":
moduleNames.add("Extension Mismatch Detector"); moduleNames.add("Extension Mismatch Detector");
break; break;
case "EWF Verify":
moduleNames.add("EWF Verifier");
break;
default: default:
moduleNames.add(name); moduleNames.add(name);
} }

View File

@ -35,6 +35,8 @@ import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Content;
// RJCTODO: Fix comment // 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 * IngestManager sets up and manages ingest modules runs them in a background
* thread notifies modules when work is complete or should be interrupted * thread notifies modules when work is complete or should be interrupted
@ -50,7 +52,7 @@ public class IngestManager {
private static IngestManager instance; private static IngestManager instance;
private final IngestScheduler scheduler; private final IngestScheduler scheduler;
private final IngestMonitor ingestMonitor = new IngestMonitor(); private final IngestMonitor ingestMonitor = new IngestMonitor();
private final HashMap<Long, DataSourceIngestTask> ingestJobs = new HashMap<>(); private final HashMap<Long, IngestJob> ingestJobs = new HashMap<>();
private TaskSchedulingWorker taskSchedulingWorker; private TaskSchedulingWorker taskSchedulingWorker;
private FileTaskWorker fileTaskWorker; private FileTaskWorker fileTaskWorker;
private DataSourceTaskWorker dataSourceTaskWorker; private DataSourceTaskWorker dataSourceTaskWorker;
@ -261,13 +263,13 @@ public class IngestManager {
* @param pipelineContext ingest context used to ingest parent of the file * @param pipelineContext ingest context used to ingest parent of the file
* to be scheduled * to be scheduled
*/ */
void scheduleFileTask(long ingestJobId, AbstractFile file) { // RJCTODO: With the module context, this can be passed the task itself void scheduleFileTask(long ingestJobId, AbstractFile file) { // RJCTODO: Consider renaming method
DataSourceIngestTask job = this.ingestJobs.get(ingestJobId); // RJCTODO: Consider renaming IngestJob job = this.ingestJobs.get(ingestJobId);
if (job == null) { if (job == null) {
// RJCTODO: Handle severe error // 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 * worker
*/ */
private synchronized void startAll() { private synchronized void startAll() {
// RJCTODO: What does this do?
if (!ingestMonitor.isRunning()) { if (!ingestMonitor.isRunning()) {
ingestMonitor.start(); ingestMonitor.start();
} }
if (scheduler.getDataSourceScheduler().hasNext()) { if (scheduler.getDataSourceScheduler().hasNext()) {
if (dataSourceTaskWorker == null || dataSourceTaskWorker.isDone()) { if (dataSourceTaskWorker == null || dataSourceTaskWorker.isDone()) {
dataSourceTaskWorker = new DataSourceTaskWorker(getNextThreadId()); // RJCTODO: May not need method call dataSourceTaskWorker = new DataSourceTaskWorker(getNextThreadId());
dataSourceTaskWorker.execute(); dataSourceTaskWorker.execute();
} }
} }
if (scheduler.getFileScheduler().hasNext()) { if (scheduler.getFileScheduler().hasNext()) {
if (fileTaskWorker == null || fileTaskWorker.isDone()) { if (fileTaskWorker == null || fileTaskWorker.isDone()) {
fileTaskWorker = new FileTaskWorker(getNextThreadId()); // RJCTODO: May not need method call fileTaskWorker = new FileTaskWorker(getNextThreadId());
fileTaskWorker.execute(); fileTaskWorker.execute();
} }
} }
} }
synchronized void reportThreadDone(long threadId) { synchronized void reportThreadDone(long threadId) {
for (DataSourceIngestTask job : ingestJobs.values()) { for (IngestJob job : ingestJobs.values()) {
job.releaseIngestPipelinesForThread(threadId); job.releaseIngestPipelinesForThread(threadId);
// RJCTODO: Add logging of errors or send ingest messages
if (job.areIngestPipelinesShutDown()) { if (job.areIngestPipelinesShutDown()) {
ingestJobs.remove(job.getId()); ingestJobs.remove(job.getId());
} }
@ -326,7 +326,7 @@ public class IngestManager {
// Now mark all of the ingest jobs as cancelled. This way the ingest // 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 // modules will know they are being shut down due to cancellation when
// the ingest worker threads release their pipelines. // the ingest worker threads release their pipelines.
for (DataSourceIngestTask job : ingestJobs.values()) { for (IngestJob job : ingestJobs.values()) {
job.cancel(); job.cancel();
} }
@ -423,7 +423,7 @@ public class IngestManager {
} }
final String inputName = dataSource.getName(); 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<IngestModuleError> errors = ingestJob.startUpIngestPipelines(); List<IngestModuleError> errors = ingestJob.startUpIngestPipelines();
if (!errors.isEmpty()) { if (!errors.isEmpty()) {
@ -513,8 +513,8 @@ public class IngestManager {
return null; return null;
} }
DataSourceIngestTask ingestJob = scheduler.next(); IngestJob ingestJob = scheduler.next();
DataSourceIngestTask.DataSourceIngestPipeline pipeline = ingestJob.getDataSourceIngestPipelineForThread(this.id); IngestJob.DataSourceIngestPipeline pipeline = ingestJob.getDataSourceIngestPipelineForThread(this.id);
pipeline.process(this, this.progress); pipeline.process(this, this.progress);
} }
@ -588,7 +588,7 @@ public class IngestManager {
IngestScheduler.FileScheduler.FileTask task = fileScheduler.next(); IngestScheduler.FileScheduler.FileTask task = fileScheduler.next();
AbstractFile file = task.getFile(); AbstractFile file = task.getFile();
progress.progress(file.getName(), processedFiles); progress.progress(file.getName(), processedFiles);
DataSourceIngestTask.FileIngestPipeline pipeline = task.getParent().getFileIngestPipelineForThread(this.id); IngestJob.FileIngestPipeline pipeline = task.getParent().getFileIngestPipelineForThread(this.id);
pipeline.process(file); pipeline.process(file);
// Update the progress bar. // Update the progress bar.
@ -610,6 +610,7 @@ public class IngestManager {
@Override @Override
protected void done() { protected void done() {
// RJCTODO: Why was GC done here in the old code?
try { try {
super.get(); super.get();
} catch (CancellationException | InterruptedException e) { } catch (CancellationException | InterruptedException e) {

View File

@ -29,7 +29,7 @@ public interface IngestModule {
}; };
// RJCTODO: Write header comment, make sure to mention "one module instance per thread" // 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" // RJCTODO: Write header comment, make sure to mention "one module instance per thread"
void shutDown(boolean ingestJobWasCancelled); void shutDown(boolean ingestJobWasCancelled);

View File

@ -25,7 +25,7 @@ package org.sleuthkit.autopsy.ingest;
public abstract class IngestModuleAdapter implements IngestModule { public abstract class IngestModuleAdapter implements IngestModule {
@Override @Override
public void startUp(IngestModuleContext context) throws Exception { public void startUp(IngestJobContext context) throws Exception {
} }
@Override @Override

View File

@ -22,7 +22,7 @@ package org.sleuthkit.autopsy.ingest;
* Encapsulates an exception thrown by an ingest module during an operation such * 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. * 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 String moduleDisplayName;
private final Exception error; private final Exception error;

View File

@ -81,7 +81,7 @@ public interface IngestModuleFactory {
* *
* @return True if the factory provides resource configuration panels. * @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 * Gets a user interface panel that can be used to configure resources for
@ -104,7 +104,7 @@ public interface IngestModuleFactory {
* the panel. * the panel.
* @return A user interface panel for configuring ingest module resources. * @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 * Gets the default per ingest job options for instances of the family of
@ -117,7 +117,7 @@ public interface IngestModuleFactory {
* *
* @return The ingest options. * @return The ingest options.
*/ */
IngestModuleSettings getDefaultIngestJobOptions(); IngestModuleSettings getDefaultModuleSettings();
/** /**
* Queries the factory to determine if it provides user interface panels to * 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. * @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 * 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. * @param ingestOptions Per ingest job options to initialize the panel.
* @return A user interface 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 * Queries the factory to determine if it is capable of creating file ingest

View File

@ -34,27 +34,27 @@ public abstract class IngestModuleFactoryAdapter implements IngestModuleFactory
public abstract String getModuleVersionNumber(); public abstract String getModuleVersionNumber();
@Override @Override
public boolean providesResourcesConfigPanels() { public boolean providesGlobalSettingsPanel() {
return false; return false;
} }
@Override @Override
public IngestModuleGlobalSetttingsPanel getResourcesConfigPanel() { public IngestModuleGlobalSetttingsPanel getGlobalSettingsPanel() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@Override @Override
public IngestModuleSettings getDefaultIngestJobOptions() { public IngestModuleSettings getDefaultModuleSettings() {
return new NoIngestModuleSettings(); return new NoIngestModuleSettings();
} }
@Override @Override
public boolean providesIngestJobOptionsPanels() { public boolean providesModuleSettingsPanel() {
return false; return false;
} }
@Override @Override
public IngestModuleSettingsPanel getIngestJobOptionsPanel(IngestModuleSettings ingestOptions) { public IngestModuleJobSettingsPanel getModuleSettingsPanel(IngestModuleSettings ingestOptions) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -23,7 +23,7 @@ import javax.swing.JPanel;
/** /**
* Abstract base class for ingest module per ingest job options panels. * 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. * Gets the ingest options for an ingest module.

View File

@ -35,13 +35,6 @@ final class IngestModuleLoader {
private final List<IngestModuleFactory> moduleFactories = new ArrayList<>(); private final List<IngestModuleFactory> moduleFactories = new ArrayList<>();
private IngestModuleLoader() { 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<? extends IngestModuleFactory> 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() { synchronized static IngestModuleLoader getInstance() {
@ -51,7 +44,14 @@ final class IngestModuleLoader {
return instance; return instance;
} }
List<IngestModuleFactory> getIngestModuleFactories() { synchronized List<IngestModuleFactory> getIngestModuleFactories() {
moduleFactories.clear();
// RJCTODO: Need a name uniqueness test/solution?
Collection<? extends IngestModuleFactory> 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); return new ArrayList<>(moduleFactories);
} }
} }

View File

@ -26,12 +26,4 @@ import java.io.Serializable;
* application. * application.
*/ */
public interface IngestModuleSettings extends Serializable { 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();
} }

View File

@ -38,7 +38,7 @@ import org.sleuthkit.autopsy.coreutils.PlatformUtil;
*/ */
public final class IngestMonitor { 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 static final int INITIAL_INTERVAL_MS = 60000; //1 min.
private final Logger logger = Logger.getLogger(IngestMonitor.class.getName()); private final Logger logger = Logger.getLogger(IngestMonitor.class.getName());
private Timer timer; private Timer timer;
@ -102,7 +102,7 @@ public final class IngestMonitor {
return monitor.getFreeSpace(); return monitor.getFreeSpace();
} catch (SecurityException e) { } catch (SecurityException e) {
logger.log(Level.WARNING, "Error checking for free disk space on ingest data drive", 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 //check if network drive, some network filesystems always return 0
final String monitoredPath = root.getAbsolutePath(); final String monitoredPath = root.getAbsolutePath();
if (monitoredPath.startsWith("\\\\") || monitoredPath.startsWith("//")) { 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 return true; //OK
} }
if (freeSpace == IngestServices.DISK_FREE_SPACE_UNKNOWN) { if (freeSpace == DISK_FREE_SPACE_UNKNOWN) {
return true; return true;
} else { } else {
//logger.log(Level.INFO, "Checking free disk apce: " + freeSpace + " need: " + Long.toString(MIN_FREE_DISK_SPACE)); //logger.log(Level.INFO, "Checking free disk apce: " + freeSpace + " need: " + Long.toString(MIN_FREE_DISK_SPACE));

View File

@ -148,11 +148,7 @@ final class IngestScheduler {
return sb.toString(); return sb.toString();
} }
synchronized void scheduleIngestOfFiles(DataSourceIngestTask dataSourceTask) { synchronized void scheduleIngestOfFiles(IngestJob 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);
Content dataSource = dataSourceTask.getDataSource(); Content dataSource = dataSourceTask.getDataSource();
Collection<AbstractFile> rootObjects = dataSource.accept(new GetRootDirVisitor()); Collection<AbstractFile> rootObjects = dataSource.accept(new GetRootDirVisitor());
List<AbstractFile> firstLevelFiles = new ArrayList<>(); List<AbstractFile> firstLevelFiles = new ArrayList<>();
@ -188,7 +184,6 @@ final class IngestScheduler {
FileTask fileTask = new FileTask(firstLevelFile, dataSourceTask); FileTask fileTask = new FileTask(firstLevelFile, dataSourceTask);
if (shouldEnqueueTask(fileTask)) { if (shouldEnqueueTask(fileTask)) {
rootDirectoryTasks.add(fileTask); rootDirectoryTasks.add(fileTask);
// RJCTODO: Increment DataSourceTask counters (not necesssary if scanninf)
} }
} }
@ -199,7 +194,6 @@ final class IngestScheduler {
updateQueues(); updateQueues();
} }
// RJCTODO:
/** /**
* Schedule a file to the file ingest, with associated modules. This * Schedule a file to the file ingest, with associated modules. This
* will add the file to beginning of the file queue. The method is * 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 * @param originalContext original content schedule context that was used
* to schedule the parent origin content, with the modules, settings, etc. * 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); FileTask fileTask = new FileTask(file, ingestJob);
if (shouldEnqueueTask(fileTask)) { if (shouldEnqueueTask(fileTask)) {
fileTasks.addFirst(fileTask); fileTasks.addFirst(fileTask);
@ -221,7 +215,6 @@ final class IngestScheduler {
} }
} }
// RJCTODO: Used? If not anymore, why?
float getPercentageDone() { float getPercentageDone() {
if (filesEnqueuedEst == 0) { if (filesEnqueuedEst == 0) {
return 0; return 0;
@ -229,7 +222,6 @@ final class IngestScheduler {
return ((100.f) * filesDequeued) / filesEnqueuedEst; return ((100.f) * filesDequeued) / filesEnqueuedEst;
} }
// RJCTODO: Used? If not anymore, why?
/** /**
* query num files enqueued total num of files to be enqueued. * query num files enqueued total num of files to be enqueued.
* *
@ -252,7 +244,6 @@ final class IngestScheduler {
return totalFiles; return totalFiles;
} }
// RJCTODO: Used? If not anymore, why?
/** /**
* get total est. number of files to be enqueued for current ingest * get total est. number of files to be enqueued for current ingest
* input sources in queues * input sources in queues
@ -263,7 +254,6 @@ final class IngestScheduler {
return filesEnqueuedEst; return filesEnqueuedEst;
} }
// RJCTODO: Used? If not anymore, why?
/** /**
* Get number of files dequeued so far. This is reset after the same * Get number of files dequeued so far. This is reset after the same
* content is enqueued that is already in a queue * content is enqueued that is already in a queue
@ -462,14 +452,14 @@ final class IngestScheduler {
*/ */
static class FileTask { static class FileTask {
private final AbstractFile file; 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.file = file;
this.task = task; 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; return task;
} }
@ -509,8 +499,8 @@ final class IngestScheduler {
if (this.file != other.file && (this.file == null || !this.file.equals(other.file))) { if (this.file != other.file && (this.file == null || !this.file.equals(other.file))) {
return false; return false;
} }
DataSourceIngestTask thisTask = this.getParent(); IngestJob thisTask = this.getParent();
DataSourceIngestTask otherTask = other.getParent(); IngestJob otherTask = other.getParent();
if (thisTask != otherTask if (thisTask != otherTask
&& (thisTask == null || !thisTask.equals(otherTask))) { && (thisTask == null || !thisTask.equals(otherTask))) {
@ -766,15 +756,15 @@ final class IngestScheduler {
/** /**
* DataSourceScheduler ingest scheduler * DataSourceScheduler ingest scheduler
*/ */
static class DataSourceScheduler implements Iterator<DataSourceIngestTask> { static class DataSourceScheduler implements Iterator<IngestJob> {
private LinkedList<DataSourceIngestTask> tasks; private LinkedList<IngestJob> tasks;
DataSourceScheduler() { DataSourceScheduler() {
tasks = new LinkedList<>(); tasks = new LinkedList<>();
} }
synchronized void schedule(DataSourceIngestTask task) { synchronized void schedule(IngestJob task) {
try { try {
if (task.getDataSource().getParent() != null) { if (task.getDataSource().getParent() != null) {
//only accepting parent-less content objects (Image, parentless VirtualDirectory) //only accepting parent-less content objects (Image, parentless VirtualDirectory)
@ -790,12 +780,12 @@ final class IngestScheduler {
} }
@Override @Override
public synchronized DataSourceIngestTask next() throws IllegalStateException { public synchronized IngestJob next() throws IllegalStateException {
if (!hasNext()) { if (!hasNext()) {
throw new IllegalStateException("There is no data source tasks in the queue, check 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; return ret;
} }
@ -806,7 +796,7 @@ final class IngestScheduler {
*/ */
synchronized List<org.sleuthkit.datamodel.Content> getContents() { synchronized List<org.sleuthkit.datamodel.Content> getContents() {
List<org.sleuthkit.datamodel.Content> contents = new ArrayList<org.sleuthkit.datamodel.Content>(); List<org.sleuthkit.datamodel.Content> contents = new ArrayList<org.sleuthkit.datamodel.Content>();
for (DataSourceIngestTask task : tasks) { for (IngestJob task : tasks) {
contents.add(task.getDataSource()); contents.add(task.getDataSource());
} }
return contents; return contents;
@ -834,7 +824,7 @@ final class IngestScheduler {
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("DataSourceQueue, size: ").append(getCount()); sb.append("DataSourceQueue, size: ").append(getCount());
for (DataSourceIngestTask task : tasks) { for (IngestJob task : tasks) {
sb.append(task.toString()).append(" "); sb.append(task.toString()).append(" ");
} }
return sb.toString(); return sb.toString();

View File

@ -18,14 +18,10 @@
*/ */
package org.sleuthkit.autopsy.ingest; package org.sleuthkit.autopsy.ingest;
import java.io.File;
import java.util.Collection;
import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.SleuthkitCase;
/** /**
@ -34,7 +30,6 @@ import org.sleuthkit.datamodel.SleuthkitCase;
* singleton instance. * singleton instance.
*/ */
public final class IngestServices { 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 static final Logger logger = Logger.getLogger(IngestServices.class.getName());
private IngestManager manager; private IngestManager manager;
@ -151,4 +146,6 @@ public final class IngestServices {
public long getFreeDiskSpace() { public long getFreeDiskSpace() {
return manager.getFreeDiskSpace(); return manager.getFreeDiskSpace();
} }
// RJCTODO: Add properties methods back into IngestServices
} }

View File

@ -21,7 +21,7 @@ package org.sleuthkit.autopsy.ingest;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import org.sleuthkit.datamodel.Content; 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. * Event data that are fired off by ingest modules when they changed or added new content.
*/ */

View File

@ -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. * By design, only a single type of artifacts can be contained in a single data event.
*/ */
// RJCTODO: Rename
public class ModuleDataEvent extends ChangeEvent { public class ModuleDataEvent extends ChangeEvent {
private String moduleName; private String moduleName;

View File

@ -24,7 +24,7 @@ package org.sleuthkit.autopsy.ingest;
*/ */
public final class NoIngestModuleSettings implements IngestModuleSettings { 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 * 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" * @return The string "None"
*/ */
String getOptions() { String getSetting() {
return options; return setting;
}
@Override
public boolean areValid() {
return true;
} }
} }

View File

@ -65,7 +65,7 @@ public final class ExifParserFileIngestModule extends IngestModuleAdapter implem
} }
@Override @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); super.startUp(context);
services = IngestServices.getDefault(); services = IngestServices.getDefault();
logger.log(Level.INFO, "init() {0}", this.toString()); logger.log(Level.INFO, "init() {0}", this.toString());

View File

@ -24,16 +24,13 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.logging.Level;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import javax.swing.table.AbstractTableModel; import javax.swing.table.AbstractTableModel;
import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel; import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel;
//import org.sleuthkit.autopsy.corecomponents.OptionsPanel; import org.sleuthkit.autopsy.filetypeid.FileTypeIdIngestModule;
//import org.sleuthkit.autopsy.coreutils.Logger;
//import org.sleuthkit.autopsy.filetypeid.FileTypeIdIngestModule; RJCTODO
/** /**
* Container panel for File Extension Mismatch Ingest Module advanced configuration options * Container panel for File Extension Mismatch Ingest Module advanced configuration options
@ -404,12 +401,11 @@ final class FileExtMismatchConfigPanel extends IngestModuleGlobalSetttingsPanel
return; return;
} }
// RJCTODO if (!FileTypeIdIngestModule.isMimeTypeDetectable(newMime)) {
// if (!FileTypeIdIngestModule.isMimeTypeDetectable(newMime)) { mimeErrLabel.setForeground(Color.red);
// mimeErrLabel.setForeground(Color.red); mimeErrLabel.setText("MIME type is not detectable by this module.");
// mimeErrLabel.setText("MIME type is not detectable by this module."); return;
// return; }
// }
editableMap.put(newMime, new String[0]); editableMap.put(newMime, new String[0]);
@ -505,29 +501,27 @@ final class FileExtMismatchConfigPanel extends IngestModuleGlobalSetttingsPanel
@Override @Override
public void load() { public void load() {
// RJCTODO
// Load the XML into a buffer that the user can modify. They can choose // Load the XML into a buffer that the user can modify. They can choose
// to save it back to the file after making changes. // to save it back to the file after making changes.
// editableMap = FileExtMismatchXML.getDefault().load(); editableMap = FileExtMismatchXML.getDefault().load();
updateMimeList(); updateMimeList();
updateExtList(); updateExtList();
} }
@Override @Override
public void store() { public void store() {
// RJCTODO if (FileExtMismatchXML.getDefault().save(editableMap)) {
// if (FileExtMismatchXML.getDefault().save(editableMap)) { mimeErrLabel.setText(" ");
// mimeErrLabel.setText(" "); mimeRemoveErrLabel.setText(" ");
// mimeRemoveErrLabel.setText(" "); extRemoveErrLabel.setText(" ");
// extRemoveErrLabel.setText(" "); extErrorLabel.setText(" ");
// extErrorLabel.setText(" ");
// saveMsgLabel.setText("Saved.");
// saveMsgLabel.setText("Saved."); saveButton.setEnabled(false);
// saveButton.setEnabled(false); } else {
// } else { //error
// //error JOptionPane.showMessageDialog(this, "Writing XML configuration file failed.", "Save Error", JOptionPane.ERROR_MESSAGE);
// JOptionPane.showMessageDialog(this, "Writing XML configuration file failed.", "Save Error", JOptionPane.ERROR_MESSAGE); }
// }
} }
private void setIsModified() { private void setIsModified() {

View File

@ -24,7 +24,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter;
import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.autopsy.ingest.FileIngestModule;
import org.sleuthkit.autopsy.ingest.IngestModuleFactory; import org.sleuthkit.autopsy.ingest.IngestModuleFactory;
import org.sleuthkit.autopsy.ingest.IngestModuleSettings; import org.sleuthkit.autopsy.ingest.IngestModuleSettings;
import org.sleuthkit.autopsy.ingest.IngestModuleSettingsPanel; import org.sleuthkit.autopsy.ingest.IngestModuleJobSettingsPanel;
import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel; import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel;
/** /**
@ -57,28 +57,28 @@ public class FileExtMismatchDetectorModuleFactory extends IngestModuleFactoryAda
} }
@Override @Override
public IngestModuleSettings getDefaultIngestJobOptions() { public IngestModuleSettings getDefaultModuleSettings() {
return new FileExtMismatchDetectorOptions(); return new FileExtMismatchDetectorOptions();
} }
@Override @Override
public boolean providesIngestJobOptionsPanels() { public boolean providesModuleSettingsPanel() {
return true; return true;
} }
@Override @Override
public IngestModuleSettingsPanel getIngestJobOptionsPanel(IngestModuleSettings ingestOptions) { public IngestModuleJobSettingsPanel getModuleSettingsPanel(IngestModuleSettings ingestOptions) {
FileExtMismatchSimpleConfigPanel ingestOptionsPanel = new FileExtMismatchSimpleConfigPanel((FileExtMismatchDetectorOptions) ingestOptions); FileExtMismatchSimpleConfigPanel ingestOptionsPanel = new FileExtMismatchSimpleConfigPanel((FileExtMismatchDetectorOptions) ingestOptions);
return ingestOptionsPanel; return ingestOptionsPanel;
} }
@Override @Override
public boolean providesResourcesConfigPanels() { public boolean providesGlobalSettingsPanel() {
return true; return true;
} }
@Override @Override
public IngestModuleGlobalSetttingsPanel getResourcesConfigPanel() { public IngestModuleGlobalSetttingsPanel getGlobalSettingsPanel() {
FileExtMismatchConfigPanel globalOptionsPanel = new FileExtMismatchConfigPanel(); FileExtMismatchConfigPanel globalOptionsPanel = new FileExtMismatchConfigPanel();
globalOptionsPanel.load(); globalOptionsPanel.load();
return globalOptionsPanel; return globalOptionsPanel;

View File

@ -61,9 +61,4 @@ public class FileExtMismatchDetectorOptions implements IngestModuleSettings {
boolean getSkipFilesWithTextPlainMimeType() { boolean getSkipFilesWithTextPlainMimeType() {
return skipFilesWithTextPlainMimeType; return skipFilesWithTextPlainMimeType;
} }
@Override
public boolean areValid() {
return true;
}
} }

View File

@ -58,7 +58,7 @@ public class FileExtMismatchIngestModule extends IngestModuleAdapter implements
} }
@Override @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); super.startUp(context);
services = IngestServices.getDefault(); services = IngestServices.getDefault();
FileExtMismatchXML xmlLoader = FileExtMismatchXML.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())); 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) { public void setSkipKnown(boolean flag) {
skipKnown = flag; skipKnown = flag;
} }
// RJCTODO: Ingest setting
public void setSkipNoExt(boolean flag) { public void setSkipNoExt(boolean flag) {
skipNoExt = flag; skipNoExt = flag;
} }
// RJCTODO: Ingest setting
public void setSkipTextPlain(boolean flag) { public void setSkipTextPlain(boolean flag) {
skipTextPlain = flag; skipTextPlain = flag;
} }

View File

@ -19,13 +19,13 @@
package org.sleuthkit.autopsy.fileextmismatch; package org.sleuthkit.autopsy.fileextmismatch;
import org.sleuthkit.autopsy.ingest.IngestModuleSettings; 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 * UI component used to set ingest job options for file extension mismatch
* detector ingest modules. * detector ingest modules.
*/ */
class FileExtMismatchSimpleConfigPanel extends IngestModuleSettingsPanel { class FileExtMismatchSimpleConfigPanel extends IngestModuleJobSettingsPanel {
private FileExtMismatchDetectorOptions ingestJobOptions; private FileExtMismatchDetectorOptions ingestJobOptions;

View File

@ -105,4 +105,14 @@ public class FileTypeIdIngestModule extends IngestModuleAdapter implements FileI
detailsSb.append("</table>"); detailsSb.append("</table>");
IngestServices.getDefault().postMessage(IngestMessage.createMessage(++messageId, IngestMessage.MessageType.INFO, FileTypeIdentifierModuleFactory.getModuleName(), "File Type Id Results", detailsSb.toString())); 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);
}
} }

View File

@ -19,13 +19,13 @@
package org.sleuthkit.autopsy.filetypeid; package org.sleuthkit.autopsy.filetypeid;
import org.sleuthkit.autopsy.ingest.IngestModuleSettings; 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 * UI component used to set ingest job options for file type identifier ingest
* modules. * modules.
*/ */
class FileTypeIdSimpleConfigPanel extends IngestModuleSettingsPanel { class FileTypeIdSimpleConfigPanel extends IngestModuleJobSettingsPanel {
private final FileTypeIdentifierIngestJobOptions ingestJobOptions; private final FileTypeIdentifierIngestJobOptions ingestJobOptions;

View File

@ -41,9 +41,4 @@ public class FileTypeIdentifierIngestJobOptions implements IngestModuleSettings
boolean shouldSkipKnownFiles() { boolean shouldSkipKnownFiles() {
return skipKnownFiles; return skipKnownFiles;
} }
@Override
public boolean areValid() {
return true;
}
} }

View File

@ -24,7 +24,7 @@ import org.sleuthkit.autopsy.ingest.FileIngestModule;
import org.sleuthkit.autopsy.ingest.IngestModuleFactory; import org.sleuthkit.autopsy.ingest.IngestModuleFactory;
import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter; import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter;
import org.sleuthkit.autopsy.ingest.IngestModuleSettings; 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 * An factory that creates file ingest modules that determine the types of
@ -56,17 +56,17 @@ public class FileTypeIdentifierModuleFactory extends IngestModuleFactoryAdapter
} }
@Override @Override
public IngestModuleSettings getDefaultIngestJobOptions() { public IngestModuleSettings getDefaultModuleSettings() {
return new FileTypeIdentifierIngestJobOptions(); return new FileTypeIdentifierIngestJobOptions();
} }
@Override @Override
public boolean providesIngestJobOptionsPanels() { public boolean providesModuleSettingsPanel() {
return true; return true;
} }
@Override @Override
public IngestModuleSettingsPanel getIngestJobOptionsPanel(IngestModuleSettings ingestJobOptions) { public IngestModuleJobSettingsPanel getModuleSettingsPanel(IngestModuleSettings ingestJobOptions) {
return new FileTypeIdSimpleConfigPanel((FileTypeIdentifierIngestJobOptions) ingestJobOptions); return new FileTypeIdSimpleConfigPanel((FileTypeIdentifierIngestJobOptions) ingestJobOptions);
} }

View File

@ -32,11 +32,12 @@ import org.openide.util.NbBundle;
import org.openide.util.Utilities; import org.openide.util.Utilities;
import org.openide.util.Lookup; import org.openide.util.Lookup;
import org.openide.util.actions.Presenter; 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.autopsy.coreutils.Logger;
import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskCoreException;
import static org.sleuthkit.autopsy.hashdatabase.HashDbManager.HashDb; 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. * 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); super(SINGLE_SELECTION_NAME);
// Disable the menu if file ingest is in progress. // Disable the menu if file ingest is in progress.
IngestConfigurator ingestConfigurator = Lookup.getDefault().lookup(IngestConfigurator.class); if (IngestManager.getDefault().isIngestRunning()) {
if (null != ingestConfigurator && ingestConfigurator.isIngestRunning()) {
setEnabled(false); setEnabled(false);
return; return;
} }

View File

@ -44,7 +44,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleAdapter;
import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.autopsy.ingest.FileIngestModule;
import org.sleuthkit.datamodel.HashInfo; 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 { public class HashDbIngestModule extends IngestModuleAdapter implements FileIngestModule {
private static final Logger logger = Logger.getLogger(HashDbIngestModule.class.getName()); private static final Logger logger = Logger.getLogger(HashDbIngestModule.class.getName());
private static final int MAX_COMMENT_SIZE = 500; private static final int MAX_COMMENT_SIZE = 500;
@ -63,7 +63,7 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges
} }
@Override @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); super.startUp(context);
services = IngestServices.getDefault(); services = IngestServices.getDefault();
skCase = Case.getCurrentCase().getSleuthkitCase(); skCase = Case.getCurrentCase().getSleuthkitCase();

View File

@ -33,12 +33,12 @@ import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.autopsy.hashdatabase.HashDbManager.HashDb; import org.sleuthkit.autopsy.hashdatabase.HashDbManager.HashDb;
import org.sleuthkit.autopsy.ingest.IngestModuleSettings; 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. * 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 knownTableModel;
private HashDatabasesTableModel knownBadTableModel; private HashDatabasesTableModel knownBadTableModel;
@ -77,7 +77,6 @@ public class HashDbSimpleConfigPanel extends IngestModuleSettingsPanel {
@Override @Override
public IngestModuleSettings getIngestJobOptions() { public IngestModuleSettings getIngestJobOptions() {
// RJCTODO: Work out how this works, load() and store(), etc.
HashDbManager hashDbManager = HashDbManager.getInstance(); HashDbManager hashDbManager = HashDbManager.getInstance();
List<HashDbManager.HashDb> knownFileHashSets = hashDbManager.getKnownFileHashSets(); List<HashDbManager.HashDb> knownFileHashSets = hashDbManager.getKnownFileHashSets();
List<HashDbManager.HashDb> knownBadFileHashSets = hashDbManager.getKnownBadFileHashSets(); List<HashDbManager.HashDb> knownBadFileHashSets = hashDbManager.getKnownBadFileHashSets();

View File

@ -25,7 +25,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter;
import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.autopsy.ingest.FileIngestModule;
import org.sleuthkit.autopsy.ingest.IngestModuleFactory; import org.sleuthkit.autopsy.ingest.IngestModuleFactory;
import org.sleuthkit.autopsy.ingest.IngestModuleSettings; import org.sleuthkit.autopsy.ingest.IngestModuleSettings;
import org.sleuthkit.autopsy.ingest.IngestModuleSettingsPanel; import org.sleuthkit.autopsy.ingest.IngestModuleJobSettingsPanel;
import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel; import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel;
/** /**
@ -54,29 +54,29 @@ public class HashLookupModuleFactory extends IngestModuleFactoryAdapter {
} }
@Override @Override
public IngestModuleSettings getDefaultIngestJobOptions() { public IngestModuleSettings getDefaultModuleSettings() {
return new HashLookupOptions(); return new HashLookupOptions();
} }
@Override @Override
public boolean providesIngestJobOptionsPanels() { public boolean providesModuleSettingsPanel() {
return true; return true;
} }
@Override @Override
public IngestModuleSettingsPanel getIngestJobOptionsPanel(IngestModuleSettings ingestOptions) { public IngestModuleJobSettingsPanel getModuleSettingsPanel(IngestModuleSettings ingestOptions) {
HashDbSimpleConfigPanel ingestOptionsPanel = new HashDbSimpleConfigPanel(); HashDbSimpleConfigPanel ingestOptionsPanel = new HashDbSimpleConfigPanel();
ingestOptionsPanel.load(); ingestOptionsPanel.load();
return ingestOptionsPanel; return ingestOptionsPanel;
} }
@Override @Override
public boolean providesResourcesConfigPanels() { public boolean providesGlobalSettingsPanel() {
return true; return true;
} }
@Override @Override
public IngestModuleGlobalSetttingsPanel getResourcesConfigPanel() { public IngestModuleGlobalSetttingsPanel getGlobalSettingsPanel() {
HashDbConfigPanel resourcesConfigPanel = new HashDbConfigPanel(); HashDbConfigPanel resourcesConfigPanel = new HashDbConfigPanel();
resourcesConfigPanel.load(); resourcesConfigPanel.load();
return resourcesConfigPanel; return resourcesConfigPanel;

View File

@ -28,6 +28,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleSettings;
// Note that this class is not yet used as intended. // Note that this class is not yet used as intended.
public class HashLookupOptions implements IngestModuleSettings { public class HashLookupOptions implements IngestModuleSettings {
// RJCTODO: These should not be handle objects, but names or files
private boolean shouldCalculateHashes = true; private boolean shouldCalculateHashes = true;
private ArrayList<HashDbManager.HashDb> knownFileHashSets; private ArrayList<HashDbManager.HashDb> knownFileHashSets;
private ArrayList<HashDbManager.HashDb> knownBadFileHashSets; private ArrayList<HashDbManager.HashDb> knownBadFileHashSets;
@ -44,12 +45,6 @@ public class HashLookupOptions implements IngestModuleSettings {
this.knownBadFileHashSets = new ArrayList<>(knownBadFileHashSets); this.knownBadFileHashSets = new ArrayList<>(knownBadFileHashSets);
} }
@Override
public boolean areValid() {
// RJCTODO: Verify that hash sets are present in hash db manager
return true;
}
boolean shouldCalculateHashes() { boolean shouldCalculateHashes() {
return shouldCalculateHashes; return shouldCalculateHashes;
} }

View File

@ -21,9 +21,6 @@ package org.sleuthkit.autopsy.keywordsearch;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
/**
* RJCTODO
*/
public class KeywordList { public class KeywordList {
private String name; private String name;

View File

@ -54,7 +54,7 @@ import org.sleuthkit.autopsy.ingest.IngestServices;
import org.sleuthkit.autopsy.ingest.IngestMessage; import org.sleuthkit.autopsy.ingest.IngestMessage;
import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType; import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
import org.sleuthkit.autopsy.ingest.IngestModuleAdapter; 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.ingest.ModuleDataEvent;
import org.sleuthkit.autopsy.keywordsearch.Ingester.IngesterException; import org.sleuthkit.autopsy.keywordsearch.Ingester.IngesterException;
import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardArtifact;
@ -117,8 +117,6 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
private volatile int messageID = 0; private volatile int messageID = 0;
private boolean processedFiles; private boolean processedFiles;
private volatile boolean finalSearcherDone = true; //mark as done, until it's inited 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 SleuthkitCase caseHandle = null;
private static List<AbstractFileExtract> textExtractors; private static List<AbstractFileExtract> textExtractors;
private static AbstractFileStringExtract stringExtractor; private static AbstractFileStringExtract stringExtractor;
@ -161,15 +159,6 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
return ResultCode.OK; 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)) { if (KeywordSearchSettings.getSkipKnown() && abstractFile.getKnown().equals(FileKnown.KNOWN)) {
//index meta-data only //index meta-data only
indexer.indexFile(abstractFile, false); indexer.indexFile(abstractFile, false);
@ -298,7 +287,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
* *
*/ */
@Override @Override
public void startUp(IngestModuleContext context) throws Exception { public void startUp(IngestJobContext context) throws Exception {
super.startUp(context); super.startUp(context);
logger.log(Level.INFO, "init()"); logger.log(Level.INFO, "init()");
services = IngestServices.getDefault(); services = IngestServices.getDefault();

View File

@ -28,13 +28,13 @@ import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableColumn; import javax.swing.table.TableColumn;
import org.sleuthkit.autopsy.coreutils.StringExtract.StringExtractUnicodeTable.SCRIPT; import org.sleuthkit.autopsy.coreutils.StringExtract.StringExtractUnicodeTable.SCRIPT;
import org.sleuthkit.autopsy.ingest.IngestModuleSettings; import org.sleuthkit.autopsy.ingest.IngestModuleSettings;
import org.sleuthkit.autopsy.ingest.IngestModuleSettingsPanel; import org.sleuthkit.autopsy.ingest.IngestModuleJobSettingsPanel;
import org.sleuthkit.autopsy.ingest.NoIngestModuleSettings; import org.sleuthkit.autopsy.ingest.NoIngestModuleSettings;
/** /**
* Ingest job options panel for the keyword search file ingest module. * 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()); private final static Logger logger = Logger.getLogger(KeywordSearchIngestSimplePanel.class.getName());
public static final String PROP_OPTIONS = "Keyword Search_Options"; public static final String PROP_OPTIONS = "Keyword Search_Options";

View File

@ -37,9 +37,9 @@ import java.util.logging.Level;
*/ */
abstract class KeywordSearchListsAbstract { abstract class KeywordSearchListsAbstract {
protected String filePath; // RJCTODO: Doubt this needs to be protected protected String filePath;
Map<String, KeywordList> theLists; //the keyword data // RJCTODO: This shuld be used to accumulate the lists read in Map<String, KeywordList> theLists; //the keyword data
static KeywordSearchListsXML currentInstance = null; // RJCTODO: This is inappropriate for a reader static KeywordSearchListsXML currentInstance = null;
private static final String CUR_LISTS_FILE_NAME = "keywords.xml"; // RJCTODO: This will go to the manager 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 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()); protected static final Logger logger = Logger.getLogger(KeywordSearchListsAbstract.class.getName());

View File

@ -26,7 +26,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter;
import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.autopsy.ingest.FileIngestModule;
import org.sleuthkit.autopsy.ingest.IngestModuleFactory; import org.sleuthkit.autopsy.ingest.IngestModuleFactory;
import org.sleuthkit.autopsy.ingest.IngestModuleSettings; import org.sleuthkit.autopsy.ingest.IngestModuleSettings;
import org.sleuthkit.autopsy.ingest.IngestModuleSettingsPanel; import org.sleuthkit.autopsy.ingest.IngestModuleJobSettingsPanel;
import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel; import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel;
/** /**
@ -55,24 +55,24 @@ public class KeywordSearchModuleFactory extends IngestModuleFactoryAdapter {
} }
@Override @Override
public boolean providesIngestJobOptionsPanels() { public boolean providesModuleSettingsPanel() {
return true; return true;
} }
@Override @Override
public IngestModuleSettingsPanel getIngestJobOptionsPanel(IngestModuleSettings ingestJobOptions) { public IngestModuleJobSettingsPanel getModuleSettingsPanel(IngestModuleSettings ingestJobOptions) {
KeywordSearchIngestSimplePanel ingestOptionsPanel = new KeywordSearchIngestSimplePanel(); KeywordSearchIngestSimplePanel ingestOptionsPanel = new KeywordSearchIngestSimplePanel();
ingestOptionsPanel.load(); ingestOptionsPanel.load();
return ingestOptionsPanel; return ingestOptionsPanel;
} }
@Override @Override
public boolean providesResourcesConfigPanels() { public boolean providesGlobalSettingsPanel() {
return true; return true;
} }
@Override @Override
public IngestModuleGlobalSetttingsPanel getResourcesConfigPanel() { public IngestModuleGlobalSetttingsPanel getGlobalSettingsPanel() {
KeywordSearchConfigurationPanel globalOptionsPanel = new KeywordSearchConfigurationPanel(); KeywordSearchConfigurationPanel globalOptionsPanel = new KeywordSearchConfigurationPanel();
globalOptionsPanel.load(); globalOptionsPanel.load();
return globalOptionsPanel; return globalOptionsPanel;

View File

@ -36,7 +36,7 @@ import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Content;
import org.sleuthkit.autopsy.ingest.IngestModule.ResultCode; import org.sleuthkit.autopsy.ingest.IngestModule.ResultCode;
import org.sleuthkit.autopsy.ingest.IngestModuleAdapter; import org.sleuthkit.autopsy.ingest.IngestModuleAdapter;
import org.sleuthkit.autopsy.ingest.IngestModuleContext; import org.sleuthkit.autopsy.ingest.IngestJobContext;
/** /**
* Recent activity image ingest module * Recent activity image ingest module
@ -140,7 +140,7 @@ public final class RAImageIngestModule extends IngestModuleAdapter implements Da
} }
@Override @Override
public void startUp(IngestModuleContext context) throws Exception { public void startUp(IngestJobContext context) throws Exception {
services = IngestServices.getDefault(); services = IngestServices.getDefault();
Extract registry = new ExtractRegistry(); Extract registry = new ExtractRegistry();
@ -155,7 +155,7 @@ public final class RAImageIngestModule extends IngestModuleAdapter implements Da
extracters.add(iexplore); extracters.add(iexplore);
extracters.add(recentDocuments); extracters.add(recentDocuments);
extracters.add(SEUQA); // this needs to run after the web browser modules 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(chrome);
browserExtracters.add(firefox); browserExtracters.add(firefox);

View File

@ -28,7 +28,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.PlatformUtil; import org.sleuthkit.autopsy.coreutils.PlatformUtil;
import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.autopsy.ingest.FileIngestModule;
import org.sleuthkit.autopsy.ingest.IngestModuleAdapter; 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.IngestServices;
import org.sleuthkit.autopsy.ingest.ModuleContentEvent; import org.sleuthkit.autopsy.ingest.ModuleContentEvent;
import org.sleuthkit.autopsy.scalpel.jni.ScalpelOutputParser.CarvedFileMeta; import org.sleuthkit.autopsy.scalpel.jni.ScalpelOutputParser.CarvedFileMeta;
@ -57,7 +57,7 @@ class ScalpelCarverIngestModule extends IngestModuleAdapter implements FileInges
private String configFilePath; private String configFilePath;
private boolean initialized = false; private boolean initialized = false;
private ScalpelCarver carver; private ScalpelCarver carver;
private IngestModuleContext context; private IngestJobContext context;
ScalpelCarverIngestModule() { ScalpelCarverIngestModule() {
} }
@ -189,7 +189,7 @@ class ScalpelCarverIngestModule extends IngestModuleAdapter implements FileInges
} }
@Override @Override
public void startUp(IngestModuleContext context) throws Exception { public void startUp(IngestJobContext context) throws Exception {
this.context = context; this.context = context;
// make sure this is Windows // make sure this is Windows

View File

@ -56,7 +56,7 @@ import org.sleuthkit.datamodel.ReadContentInputStream;
import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.datamodel.TskData; import org.sleuthkit.datamodel.TskData;
import org.sleuthkit.autopsy.ingest.IngestModule.ResultCode; 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, * 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 static final int readHeaderSize = 4;
private final byte[] fileHeaderBuffer = new byte[readHeaderSize]; private final byte[] fileHeaderBuffer = new byte[readHeaderSize];
private static final int ZIP_SIGNATURE_BE = 0x504B0304; private static final int ZIP_SIGNATURE_BE = 0x504B0304;
private IngestModuleContext context; private IngestJobContext context;
SevenZipIngestModule() { SevenZipIngestModule() {
} }
@Override @Override
public void startUp(IngestModuleContext context) throws Exception{ public void startUp(IngestJobContext context) throws Exception{
this.context = context; this.context = context;
unpackDir = context.getOutputDirectoryRelativePath(); unpackDir = context.getOutputDirectoryRelativePath();
unpackDirPath = context.getOutputDirectoryAbsolutePath(); unpackDirPath = context.getOutputDirectoryAbsolutePath();

View File

@ -37,7 +37,7 @@ public class EwfVerifierModuleFactory extends IngestModuleFactoryAdapter {
} }
static String getModuleName() { 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 @Override

View File

@ -34,7 +34,7 @@ import org.sleuthkit.datamodel.Image;
import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.datamodel.TskData; import org.sleuthkit.datamodel.TskData;
import org.sleuthkit.autopsy.ingest.DataSourceIngestModule; 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 * 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 Logger logger = Logger.getLogger(EwfVerifyIngestModule.class.getName());
private static final long DEFAULT_CHUNK_SIZE = 32 * 1024; private static final long DEFAULT_CHUNK_SIZE = 32 * 1024;
private static final IngestServices services = IngestServices.getDefault(); private static final IngestServices services = IngestServices.getDefault();
private IngestModuleContext context; private IngestJobContext context;
private Image img; private Image img;
private String imgName; private String imgName;
private MessageDigest messageDigest; 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 verified = false;
private boolean skipped = false; private boolean skipped = false;
private String calculatedHash = ""; private String calculatedHash = "";
@ -59,7 +59,7 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo
} }
@Override @Override
public void startUp(IngestModuleContext context) throws Exception { public void startUp(IngestJobContext context) throws Exception {
this.context = context; this.context = context;
verified = false; verified = false;
skipped = 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. // Read in byte size chunks and update the hash value with the data.
for (int i = 0; i < totalChunks; i++) { for (int i = 0; i < totalChunks; i++) {
if (statusHelper.isCancelled()) { if (statusHelper.isCancelled()) {
return ResultCode.OK; // RJCTODO: Use unknown? return ResultCode.OK;
} }
data = new byte[ (int) chunkSize ]; data = new byte[ (int) chunkSize ];
try { try {

View File

@ -31,7 +31,7 @@ import org.sleuthkit.autopsy.ingest.FileIngestModule;
import org.sleuthkit.autopsy.ingest.IngestMessage; import org.sleuthkit.autopsy.ingest.IngestMessage;
import org.sleuthkit.autopsy.ingest.IngestModule.ResultCode; import org.sleuthkit.autopsy.ingest.IngestModule.ResultCode;
import org.sleuthkit.autopsy.ingest.IngestModuleAdapter; 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.IngestServices;
import org.sleuthkit.autopsy.ingest.ModuleContentEvent; import org.sleuthkit.autopsy.ingest.ModuleContentEvent;
import org.sleuthkit.autopsy.ingest.ModuleDataEvent; 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 static final Logger logger = Logger.getLogger(ThunderbirdMboxFileIngestModule.class.getName());
private IngestServices services; private IngestServices services;
private final String hashDBModuleName = "Hash Lookup";
private int messageId = 0; // RJCTODO: Not thread safe private int messageId = 0; // RJCTODO: Not thread safe
private FileManager fileManager; private FileManager fileManager;
private IngestModuleContext context; private IngestJobContext context;
ThunderbirdMboxFileIngestModule() { ThunderbirdMboxFileIngestModule() {
} }
@ -248,7 +247,7 @@ public final class ThunderbirdMboxFileIngestModule extends IngestModuleAdapter i
} }
@Override @Override
public void startUp(IngestModuleContext context) throws Exception { public void startUp(IngestJobContext context) throws Exception {
this.context = context; this.context = context;
services = IngestServices.getDefault(); services = IngestServices.getDefault();
fileManager = Case.getCurrentCase().getServices().getFileManager(); fileManager = Case.getCurrentCase().getServices().getFileManager();