From 43d64d3bece7f944a802fb56cf3a97ef140ac90e Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 13 Sep 2013 13:34:42 -0400 Subject: [PATCH 1/7] Added GeneralIngestConfigurator support for tracking and checking enabled ingest modules --- .../casemodule/GeneralIngestConfigurator.java | 47 +++++++++++-------- .../autopsy/ingest/IngestDialogPanel.java | 6 +-- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/GeneralIngestConfigurator.java b/Core/src/org/sleuthkit/autopsy/casemodule/GeneralIngestConfigurator.java index ba486f33a6..58798d5573 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/GeneralIngestConfigurator.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/GeneralIngestConfigurator.java @@ -21,18 +21,19 @@ package org.sleuthkit.autopsy.casemodule; import java.util.ArrayList; import java.util.List; +import javax.swing.JOptionPane; import javax.swing.JPanel; import org.openide.util.lookup.ServiceProvider; import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.autopsy.ingest.IngestDialogPanel; -import static org.sleuthkit.autopsy.ingest.IngestDialogPanel.DISABLED_MOD; -import static org.sleuthkit.autopsy.ingest.IngestDialogPanel.PARSE_UNALLOC; import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.autopsy.ingest.IngestModuleAbstract; import org.sleuthkit.datamodel.Content; @ServiceProvider(service = IngestConfigurator.class) -public class GeneralIngestConfigurator implements IngestConfigurator { +public class GeneralIngestConfigurator implements IngestConfigurator { + public static final String ENABLED_INGEST_MODULES_KEY = "Enabled_Ingest_Modules"; + public static final String PARSE_UNALLOC_SPACE_KEY = "Process_Unallocated_Space"; private List contentToIngest; private IngestManager manager; private IngestDialogPanel ingestDialogPanel; @@ -79,21 +80,19 @@ public class GeneralIngestConfigurator implements IngestConfigurator { @Override public void save() { - // Save the user's configuration of the currently selected module. + // Save the user's configuration of the currently selected ingest module. IngestModuleAbstract currentModule = ingestDialogPanel.getCurrentIngestModule(); if (currentModule != null && currentModule.hasSimpleConfiguration()) { currentModule.saveSimpleConfiguration(); } - // Create a list of the modules the user wants to be disabled. - List disabledModules = IngestManager.getDefault().enumerateAllModules(); - disabledModules.removeAll(ingestDialogPanel.getModulesToStart()); - String disabledModulesCsv = moduleListToCsv(disabledModules); + // Save the user's configuration of the set of enabled ingest modules. + String enabledModulesCsvList = moduleListToCsv(ingestDialogPanel.getModulesToStart()); + ModuleSettings.setConfigSetting(moduleContext, ENABLED_INGEST_MODULES_KEY, enabledModulesCsvList); // Save the user's general ingest configuration. - ModuleSettings.setConfigSetting(moduleContext, DISABLED_MOD, disabledModulesCsv); String processUnalloc = Boolean.toString(ingestDialogPanel.processUnallocSpaceEnabled()); - ModuleSettings.setConfigSetting(moduleContext, PARSE_UNALLOC, processUnalloc); + ModuleSettings.setConfigSetting(moduleContext, PARSE_UNALLOC_SPACE_KEY, processUnalloc); } @Override @@ -132,28 +131,38 @@ public class GeneralIngestConfigurator implements IngestConfigurator { String[] moduleNames = csv.split(", "); List allModules = IngestManager.getDefault().enumerateAllModules(); for (String moduleName : moduleNames) { + boolean moduleFound = false; for (IngestModuleAbstract module : allModules) { if (moduleName.equals(module.getName())) { modules.add(module); + moduleFound = true; break; } } + if (moduleFound == false) { + JOptionPane.showMessageDialog(null, "Failed to find and load " + moduleName + " module", "Ingest Module Not Found", JOptionPane.ERROR_MESSAGE); + } } return modules; } private void loadSettings() { - // get the csv list of disabled modules - String disabledModulesCsv = ModuleSettings.getConfigSetting(moduleContext, DISABLED_MOD); + loadEnabledIngestModulesSetting(); - // create a list of modules from it - List disabledModules = csvToModuleList(disabledModulesCsv); - - // tell the ingestDialogPanel to unselect these modules - ingestDialogPanel.setDisabledModules(disabledModules); - - boolean processUnalloc = Boolean.parseBoolean(ModuleSettings.getConfigSetting(moduleContext, PARSE_UNALLOC)); + boolean processUnalloc = Boolean.parseBoolean(ModuleSettings.getConfigSetting(moduleContext, PARSE_UNALLOC_SPACE_KEY)); ingestDialogPanel.setProcessUnallocSpaceEnabled(processUnalloc); } + + private void loadEnabledIngestModulesSetting() { + // If there is no enabled ingest modules setting for this user, default to enabling all + // of the ingest modules the IngestManager has loaded. + if (ModuleSettings.settingExists(moduleContext, ENABLED_INGEST_MODULES_KEY) == false) { + String defaultSetting = moduleListToCsv(IngestManager.getDefault().enumerateAllModules()); + ModuleSettings.setConfigSetting(moduleContext, ENABLED_INGEST_MODULES_KEY, defaultSetting); + } + + String enabledModulesSetting = ModuleSettings.getConfigSetting(moduleContext, ENABLED_INGEST_MODULES_KEY); + ingestDialogPanel.setEnabledIngestModules(csvToModuleList(enabledModulesSetting)); + } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java index b5308da4ce..9130c1672a 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java @@ -44,8 +44,6 @@ public class IngestDialogPanel extends javax.swing.JPanel { private IngestModuleAbstract currentModule; private ModulesTableModel tableModel; - public static final String DISABLED_MOD = "Disabled_Ingest_Modules"; - public static final String PARSE_UNALLOC = "Process_Unallocated_Space"; private String context; /** @@ -123,8 +121,8 @@ public class IngestDialogPanel extends javax.swing.JPanel { processUnallocCheckbox.setSelected(enabled); } - public void setDisabledModules(List disabledModules) { - tableModel.setUnselectedModules(disabledModules); + public void setEnabledIngestModules(List enabledModules) { + tableModel.setSelectedModules(enabledModules); } /** From 00d55023e4f3ba26ef57fe01867619734a9c9a06 Mon Sep 17 00:00:00 2001 From: Jason Letourneau Date: Fri, 6 Sep 2013 17:34:55 -0400 Subject: [PATCH 2/7] adding update notification checking - this requires autopsy-updates.xml to be uploaded to sleuthkit.org --- Core/autopsy-updates.xml | 16 ++++++++++++++++ .../org/sleuthkit/autopsy/core/Bundle.properties | 2 ++ Core/src/org/sleuthkit/autopsy/core/layer.xml | 7 +++++++ ...uthkit_autopsy_core_update_centerSettings.xml | 13 +++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 Core/autopsy-updates.xml create mode 100644 Core/src/org/sleuthkit/autopsy/core/org_sleuthkit_autopsy_core_update_centerSettings.xml diff --git a/Core/autopsy-updates.xml b/Core/autopsy-updates.xml new file mode 100644 index 0000000000..48a2898d70 --- /dev/null +++ b/Core/autopsy-updates.xml @@ -0,0 +1,16 @@ + + + + + + + + + + Visit http://sleuthkit.org/autopsy to download the latest version of Autopsy. + + + + + \ No newline at end of file diff --git a/Core/src/org/sleuthkit/autopsy/core/Bundle.properties b/Core/src/org/sleuthkit/autopsy/core/Bundle.properties index b049fd4d82..1fef6eb2f5 100644 --- a/Core/src/org/sleuthkit/autopsy/core/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/core/Bundle.properties @@ -8,3 +8,5 @@ OpenIDE-Module-Long-Description=\ For more information, see http://www.sleuthkit.org/autopsy/ OpenIDE-Module-Name=Autopsy-Core OpenIDE-Module-Short-Description=Autopsy Core Module +org_sleuthkit_autopsy_core_update_center=http://sleuthkit.org/autopsy-updates.xml +Services/AutoupdateType/org_sleuthkit_autopsy_core_update_center.settings=Autopsy Update Center diff --git a/Core/src/org/sleuthkit/autopsy/core/layer.xml b/Core/src/org/sleuthkit/autopsy/core/layer.xml index 3b5b8b481e..f43b8285d6 100644 --- a/Core/src/org/sleuthkit/autopsy/core/layer.xml +++ b/Core/src/org/sleuthkit/autopsy/core/layer.xml @@ -270,6 +270,13 @@ Services ====================================================== --> + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/core/org_sleuthkit_autopsy_core_update_centerSettings.xml b/Core/src/org/sleuthkit/autopsy/core/org_sleuthkit_autopsy_core_update_centerSettings.xml new file mode 100644 index 0000000000..c1dbc1e41e --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/core/org_sleuthkit_autopsy_core_update_centerSettings.xml @@ -0,0 +1,13 @@ + + + + + + + + + + From ed8e52682e8db611665e175514f3f9cec2fd0622 Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Mon, 16 Sep 2013 16:26:10 -0400 Subject: [PATCH 3/7] Updated URL for update.xml --- Core/src/org/sleuthkit/autopsy/core/Bundle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/core/Bundle.properties b/Core/src/org/sleuthkit/autopsy/core/Bundle.properties index 1fef6eb2f5..1bc91ef607 100644 --- a/Core/src/org/sleuthkit/autopsy/core/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/core/Bundle.properties @@ -8,5 +8,5 @@ OpenIDE-Module-Long-Description=\ For more information, see http://www.sleuthkit.org/autopsy/ OpenIDE-Module-Name=Autopsy-Core OpenIDE-Module-Short-Description=Autopsy Core Module -org_sleuthkit_autopsy_core_update_center=http://sleuthkit.org/autopsy-updates.xml +org_sleuthkit_autopsy_core_update_center=http://sleuthkit.org/autopsy/updates.xml Services/AutoupdateType/org_sleuthkit_autopsy_core_update_center.settings=Autopsy Update Center From 3228ad587d00df9abdbe0b8b32f81ff2e0c9da04 Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Mon, 16 Sep 2013 16:39:21 -0400 Subject: [PATCH 4/7] fixed timeline build.xml to work on Windows again --- Timeline/build.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Timeline/build.xml b/Timeline/build.xml index 5b1ddba371..bcc9173c7f 100644 --- a/Timeline/build.xml +++ b/Timeline/build.xml @@ -24,6 +24,6 @@ - + From 4493b7a80cd238db08c92375eba5f014c9a04167 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 16 Sep 2013 17:27:38 -0400 Subject: [PATCH 5/7] GeneralIngestConfigurator reworked to produce error msg strings from setContext() --- .../casemodule/AddImageWizardPanel3.java | 11 +- .../casemodule/IngestConfigurator.java | 73 +++++--- .../GeneralIngestConfigurator.java | 176 +++++++++--------- .../autopsy/ingest/IngestDialog.java | 13 +- .../autopsy/ingest/IngestDialogPanel.java | 2 +- 5 files changed, 150 insertions(+), 125 deletions(-) rename Core/src/org/sleuthkit/autopsy/{casemodule => ingest}/GeneralIngestConfigurator.java (69%) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java index 98aa035b8a..5167986038 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java @@ -28,6 +28,7 @@ import java.util.Collections; import java.util.List; import java.util.logging.Level; import javax.swing.JButton; +import javax.swing.JOptionPane; import javax.swing.JProgressBar; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; @@ -39,6 +40,7 @@ import org.sleuthkit.autopsy.casemodule.ContentTypePanel.ContentType; import org.sleuthkit.autopsy.casemodule.services.FileManager; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.PlatformUtil; +import org.sleuthkit.autopsy.ingest.IngestDialog; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Image; @@ -86,7 +88,14 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { this.action = action; this.wizPanel = wizPanel; ingestConfig = Lookup.getDefault().lookup(IngestConfigurator.class); - ingestConfig.setContext(AddImageWizardPanel3.class.getCanonicalName()); + List messages = ingestConfig.setContext(AddImageWizardPanel3.class.getCanonicalName()); + if (messages.isEmpty() == false) { + StringBuilder warning = new StringBuilder(); + for (String message : messages) { + warning.append(message).append("\n"); + } + JOptionPane.showMessageDialog(null, warning.toString()); + } } /** diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestConfigurator.java b/Core/src/org/sleuthkit/autopsy/casemodule/IngestConfigurator.java index 3b585b2167..f8c09b89ba 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestConfigurator.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestConfigurator.java @@ -23,47 +23,62 @@ import javax.swing.JPanel; import org.sleuthkit.datamodel.Content; /** - * Lookup interface for ingest configuration dialog + * Instances of this class provide the following services: + * 1. A way to save and load the ingest process configuration settings for a + * given ingest process context. + * 2. A UI component for configuring ingest process settings. + * 3. A way to specify input content and start the ingest process for a + * given ingest process context. */ +// @@@ This interface needs to be re-designed. An interface for allowing the +// authors of ingest modules to expose context sensitive module configuration +// settings needs to be provided; there also needs to be a way for users to +// configure the ingest process that uses those modules. These are separate +// concerns; likewise, kicking off an ingest process for particular content in +// a particular context is a separate concern. public interface IngestConfigurator { /** - * get JPanel container with the configurator - * @return + * Specifies the ingest process context for the purpose of choosing, saving, + * and loading ingest process configuration settings; also determines what + * configuration settings will be in effect if the setContent() and start() + * methods are called to start the ingest process for some content specified + * using the setContent() method. + * @return A list, possibly empty, of messages describing errors that + * occurred when loading the configuration settings. */ - JPanel getIngestConfigPanel(); + public List setContext(String contextName); /** - * set input Content to be configured for ingest - * @param inputContent content to be configured for ingest + * Provides a UI component for choosing ingest process configuration + * settings for the ingest process context specified using the setContext() + * method. + */ + JPanel getIngestConfigPanel(); + + /** + * Saves the ingest process configuration settings for the ingest process + * context specified using the setContext() method. + */ + void save(); + + /** + * Sets the input content for an ingest process prior to calling start() to + * run the process using the process configuration settings for the context + * specified using setContext(). */ void setContent(List inputContent); /** - * start ingest enqueing previously set image + * Starts (queues) the ingest process for the content specified using the + * setContent() method, using the configuration settings corresponding to + * the ingest process context specified using the setContext() method. */ void start(); - + /** - * save configuration of lastly selected service + * Returns true if any ingest process is running, false otherwise. + * Note that the running process may or may not be the process started + * (queued) by an invocation of the start() method. */ - void save(); - - /** - * reload the simple panel - */ - void reload(); - - /** - * find out if ingest is currently running - * - * @return true if ingest process is running, false otherwise - */ - boolean isIngestRunning(); - - /** - * Set the context for the configuration. - * @param context - */ - public void setContext(String context); - + boolean isIngestRunning(); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/GeneralIngestConfigurator.java b/Core/src/org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java similarity index 69% rename from Core/src/org/sleuthkit/autopsy/casemodule/GeneralIngestConfigurator.java rename to Core/src/org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java index 58798d5573..a183a4ac1f 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/GeneralIngestConfigurator.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java @@ -16,14 +16,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -package org.sleuthkit.autopsy.casemodule; +package org.sleuthkit.autopsy.ingest; import java.util.ArrayList; import java.util.List; -import javax.swing.JOptionPane; import javax.swing.JPanel; import org.openide.util.lookup.ServiceProvider; +import org.sleuthkit.autopsy.casemodule.IngestConfigurator; import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.autopsy.ingest.IngestDialogPanel; import org.sleuthkit.autopsy.ingest.IngestManager; @@ -32,6 +31,7 @@ import org.sleuthkit.datamodel.Content; @ServiceProvider(service = IngestConfigurator.class) public class GeneralIngestConfigurator implements IngestConfigurator { + public static final String ENABLED_INGEST_MODULES_KEY = "Enabled_Ingest_Modules"; public static final String PARSE_UNALLOC_SPACE_KEY = "Process_Unallocated_Space"; private List contentToIngest; @@ -40,71 +40,88 @@ public class GeneralIngestConfigurator implements IngestConfigurator { private String moduleContext; public GeneralIngestConfigurator() { - this.moduleContext = IngestManager.MODULE_PROPERTIES; // Hard-code this for now. + this.moduleContext = IngestManager.MODULE_PROPERTIES; ingestDialogPanel = new IngestDialogPanel(); ingestDialogPanel.setContext(moduleContext); manager = IngestManager.getDefault(); - loadSettings(); } @Override - public void setContext(String context) { + public List setContext(String context) { moduleContext = context; ingestDialogPanel.setContext(moduleContext); - reload(); + return loadSettingsForContext(); } + + private List loadSettingsForContext() { + List messages = new ArrayList<>(); + + // If there is no enabled ingest modules setting for this user, default to enabling all + // of the ingest modules the IngestManager has loaded. + if (ModuleSettings.settingExists(moduleContext, ENABLED_INGEST_MODULES_KEY) == false) { + String defaultSetting = moduleListToCsv(IngestManager.getDefault().enumerateAllModules()); + ModuleSettings.setConfigSetting(moduleContext, ENABLED_INGEST_MODULES_KEY, defaultSetting); + } + + // Get the enabled ingest modules setting, check for missing modules, and pass the setting to + // the UI component. + List allModules = IngestManager.getDefault().enumerateAllModules(); + String[] enabledModuleNames = ModuleSettings.getConfigSetting(moduleContext, ENABLED_INGEST_MODULES_KEY).split(", "); + List enabledModules = new ArrayList<>(); + for (String moduleName : enabledModuleNames) { + IngestModuleAbstract moduleFound = null; + for (IngestModuleAbstract module : allModules) { + if (moduleName.equals(module.getName())) { + moduleFound = module; + break; + } + } + if (moduleFound != null) { + enabledModules.add(moduleFound); + } + else { + messages.add("Unable to load " + moduleName + " module, it will not be available"); + } + } + ingestDialogPanel.setEnabledIngestModules(enabledModules); + + // If there is no process unallocated space flag setting, default it to false. + if (ModuleSettings.settingExists(moduleContext, PARSE_UNALLOC_SPACE_KEY) == false) { + ModuleSettings.setConfigSetting(moduleContext, PARSE_UNALLOC_SPACE_KEY, "false"); + } + + // Get the process unallocated space flag setting and pass it to the UI component. + boolean processUnalloc = Boolean.parseBoolean(ModuleSettings.getConfigSetting(moduleContext, PARSE_UNALLOC_SPACE_KEY)); + ingestDialogPanel.setProcessUnallocSpaceEnabled(processUnalloc); + + return messages; + } + + @Override + public JPanel getIngestConfigPanel() { + // Note that this panel allows for selecting modules for the ingest process, + // specifying the process unallocated space flag, and also specifying settings + // for a selected ingest module. + return ingestDialogPanel; + } @Override - public JPanel getIngestConfigPanel() { - return ingestDialogPanel; - } - - @Override - public void setContent(List inputContent) { - this.contentToIngest = inputContent; - } - - @Override - public void start() { - // Get the list of ingest modules selected by the user. - List modulesToStart = ingestDialogPanel.getModulesToStart(); - - // Get the user's selection of whether or not to process unallocated space. - manager.setProcessUnallocSpace(ingestDialogPanel.processUnallocSpaceEnabled()); - - // Start the ingest. - if (!modulesToStart.isEmpty()) { - manager.execute(modulesToStart, contentToIngest); - } - } - - @Override - public void save() { - // Save the user's configuration of the currently selected ingest module. - IngestModuleAbstract currentModule = ingestDialogPanel.getCurrentIngestModule(); - if (currentModule != null && currentModule.hasSimpleConfiguration()) { - currentModule.saveSimpleConfiguration(); - } - + public void save() { // Save the user's configuration of the set of enabled ingest modules. String enabledModulesCsvList = moduleListToCsv(ingestDialogPanel.getModulesToStart()); ModuleSettings.setConfigSetting(moduleContext, ENABLED_INGEST_MODULES_KEY, enabledModulesCsvList); - // Save the user's general ingest configuration. + // Save the user's setting for the process unallocated space flag. String processUnalloc = Boolean.toString(ingestDialogPanel.processUnallocSpaceEnabled()); ModuleSettings.setConfigSetting(moduleContext, PARSE_UNALLOC_SPACE_KEY, processUnalloc); - } - - @Override - public void reload() { - loadSettings(); - } - - @Override - public boolean isIngestRunning() { - return manager.isIngestRunning(); - } + // Save the user's configuration of the currently selected ingest module. + IngestModuleAbstract currentModule = ingestDialogPanel.getCurrentIngestModule(); + if (currentModule != null && currentModule.hasSimpleConfiguration()) { + currentModule.saveSimpleConfiguration(); + } + } + private static String moduleListToCsv(List lst) { if (lst == null || lst.isEmpty()) { return ""; @@ -120,49 +137,28 @@ public class GeneralIngestConfigurator implements IngestConfigurator { return sb.toString(); } - - private static List csvToModuleList(String csv) { - List modules = new ArrayList<>(); - if (csv == null || csv.isEmpty()) { - return modules; - } - - String[] moduleNames = csv.split(", "); - List allModules = IngestManager.getDefault().enumerateAllModules(); - for (String moduleName : moduleNames) { - boolean moduleFound = false; - for (IngestModuleAbstract module : allModules) { - if (moduleName.equals(module.getName())) { - modules.add(module); - moduleFound = true; - break; - } - } - if (moduleFound == false) { - JOptionPane.showMessageDialog(null, "Failed to find and load " + moduleName + " module", "Ingest Module Not Found", JOptionPane.ERROR_MESSAGE); - } - } - - return modules; + @Override + public void setContent(List inputContent) { + this.contentToIngest = inputContent; } - private void loadSettings() { - loadEnabledIngestModulesSetting(); + @Override + public void start() { + // Get the list of ingest modules selected by the user. + List modulesToStart = ingestDialogPanel.getModulesToStart(); - boolean processUnalloc = Boolean.parseBoolean(ModuleSettings.getConfigSetting(moduleContext, PARSE_UNALLOC_SPACE_KEY)); - ingestDialogPanel.setProcessUnallocSpaceEnabled(processUnalloc); - } - - private void loadEnabledIngestModulesSetting() { - // If there is no enabled ingest modules setting for this user, default to enabling all - // of the ingest modules the IngestManager has loaded. - if (ModuleSettings.settingExists(moduleContext, ENABLED_INGEST_MODULES_KEY) == false) { - String defaultSetting = moduleListToCsv(IngestManager.getDefault().enumerateAllModules()); - ModuleSettings.setConfigSetting(moduleContext, ENABLED_INGEST_MODULES_KEY, defaultSetting); - } - - String enabledModulesSetting = ModuleSettings.getConfigSetting(moduleContext, ENABLED_INGEST_MODULES_KEY); - ingestDialogPanel.setEnabledIngestModules(csvToModuleList(enabledModulesSetting)); + // Get the user's selection of whether or not to process unallocated space. + manager.setProcessUnallocSpace(ingestDialogPanel.processUnallocSpaceEnabled()); + + if (!modulesToStart.isEmpty() && contentToIngest != null) { + // Queue the ingest process. + manager.execute(modulesToStart, contentToIngest); + } } + + @Override + public boolean isIngestRunning() { + return manager.isIngestRunning(); + } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestDialog.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestDialog.java index 5305700839..e2018e4dad 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestDialog.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestDialog.java @@ -30,9 +30,8 @@ import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFrame; +import javax.swing.JOptionPane; import javax.swing.JPanel; -import org.openide.util.Lookup; -import org.sleuthkit.autopsy.casemodule.GeneralIngestConfigurator; import org.sleuthkit.datamodel.Content; import org.sleuthkit.autopsy.casemodule.IngestConfigurator; @@ -49,8 +48,14 @@ public class IngestDialog extends JDialog { public IngestDialog(JFrame frame, String title, boolean modal) { super(frame, title, modal); ingestConfigurator = new GeneralIngestConfigurator(); - ingestConfigurator.setContext(IngestDialog.class.getCanonicalName()); - ingestConfigurator.reload(); + List messages = ingestConfigurator.setContext(IngestDialog.class.getCanonicalName()); + if (messages.isEmpty() == false) { + StringBuilder warning = new StringBuilder(); + for (String message : messages) { + warning.append(message).append("\n"); + } + JOptionPane.showMessageDialog(null, warning.toString()); + } } public IngestDialog(){ diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java index 9130c1672a..331c727576 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java @@ -405,7 +405,7 @@ public class IngestDialogPanel extends javax.swing.JPanel { } /** - * Custom cell renderer for tooltips with module description + * Custom cell renderer for tool tips with module description */ private class ModulesTableRenderer extends DefaultTableCellRenderer { From 11c5aa8fd8ca750acf5933d647a0e65c275e47e4 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 16 Sep 2013 17:34:12 -0400 Subject: [PATCH 6/7] Improved GeneralIngestConfigurator error message --- .../org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java b/Core/src/org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java index a183a4ac1f..dde703f935 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java @@ -80,7 +80,7 @@ public class GeneralIngestConfigurator implements IngestConfigurator { enabledModules.add(moduleFound); } else { - messages.add("Unable to load " + moduleName + " module, it will not be available"); + messages.add("Unable to load " + moduleName + " module"); } } ingestDialogPanel.setEnabledIngestModules(enabledModules); From bd5ec5d94269825f5dade0e28b9b3809bf4d37cf Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 16 Sep 2013 17:51:26 -0400 Subject: [PATCH 7/7] Moved IngestConfigurator interface to ingest package --- Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java | 1 + .../org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java | 1 + .../org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java | 1 - .../autopsy/{casemodule => ingest}/IngestConfigurator.java | 2 +- Core/src/org/sleuthkit/autopsy/ingest/IngestDialog.java | 1 - 5 files changed, 3 insertions(+), 3 deletions(-) rename Core/src/org/sleuthkit/autopsy/{casemodule => ingest}/IngestConfigurator.java (98%) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java index cdfb561ae0..469b600ac2 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java @@ -19,6 +19,7 @@ package org.sleuthkit.autopsy.casemodule; +import org.sleuthkit.autopsy.ingest.IngestConfigurator; import java.awt.Component; import java.awt.Dialog; import java.awt.event.ActionEvent; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java index 5167986038..f8d2529fbf 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java @@ -18,6 +18,7 @@ */ package org.sleuthkit.autopsy.casemodule; +import org.sleuthkit.autopsy.ingest.IngestConfigurator; import java.awt.Color; import java.awt.Component; import java.awt.EventQueue; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java b/Core/src/org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java index dde703f935..696fe12d02 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.List; import javax.swing.JPanel; import org.openide.util.lookup.ServiceProvider; -import org.sleuthkit.autopsy.casemodule.IngestConfigurator; import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.autopsy.ingest.IngestDialogPanel; import org.sleuthkit.autopsy.ingest.IngestManager; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestConfigurator.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestConfigurator.java similarity index 98% rename from Core/src/org/sleuthkit/autopsy/casemodule/IngestConfigurator.java rename to Core/src/org/sleuthkit/autopsy/ingest/IngestConfigurator.java index f8c09b89ba..94ef6924b9 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestConfigurator.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestConfigurator.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.casemodule; +package org.sleuthkit.autopsy.ingest; import java.util.List; import javax.swing.JPanel; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestDialog.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestDialog.java index e2018e4dad..fb68c15a5e 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestDialog.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestDialog.java @@ -33,7 +33,6 @@ import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; import org.sleuthkit.datamodel.Content; -import org.sleuthkit.autopsy.casemodule.IngestConfigurator; /** * Dialog box that allows ingest modules to be run on an image.