From 2438fab5248adcb10d414643bfbc2aa478fbd2df Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Wed, 4 Jan 2017 15:41:31 -0500 Subject: [PATCH] 1902-added actionlistener for combo box --- .../sleuthkit/autopsy/ingest/IngestJobSettings.java | 7 ------- .../autopsy/ingest/IngestJobSettingsPanel.java | 12 ++++++++++-- .../autopsy/ingest/IngestTasksScheduler.java | 12 +++++------- .../autopsy/modules/interestingitems/FilesSet.java | 8 +++++--- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java index 0ee239d852..cba4d6238c 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java @@ -52,7 +52,6 @@ public class IngestJobSettings { private static final String ENABLED_MODULES_KEY = "Enabled_Ingest_Modules"; //NON-NLS private static final String DISABLED_MODULES_KEY = "Disabled_Ingest_Modules"; //NON-NLS - private static final String PARSE_UNALLOC_SPACE_KEY = "Process_Unallocated_Space"; //NON-NLS private static final String LAST_FILE_INGEST_FILTER_KEY = "Last File Ingest Filter Used"; private static final String MODULE_SETTINGS_FOLDER = "IngestModuleSettings"; //NON-NLS private static final String MODULE_SETTINGS_FOLDER_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), IngestJobSettings.MODULE_SETTINGS_FOLDER).toAbsolutePath().toString(); @@ -487,12 +486,6 @@ public class IngestJobSettings { ModuleSettings.setConfigSetting(this.executionContext, ENABLED_MODULES_KEY, makeCommaSeparatedValuesList(enabledModuleNames)); ModuleSettings.setConfigSetting(this.executionContext, DISABLED_MODULES_KEY, makeCommaSeparatedValuesList(disabledModuleNames)); - /** - * Save the process unallocated space setting. - */ - String processUnalloc = Boolean.toString(getProcessUnallocatedSpace()); - ModuleSettings.setConfigSetting(this.executionContext, PARSE_UNALLOC_SPACE_KEY, processUnalloc); - /** * Save the last used File Ingest Filter setting for this context. */ diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java index c48be25a52..e5f2d77843 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java @@ -213,6 +213,15 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { fileIngestFilterLabel = new javax.swing.JLabel(); fileIngestFilterComboBox = new javax.swing.JComboBox<>(); + fileIngestFilterLabel.setText(org.openide.util.NbBundle.getMessage(IngestJobSettingsPanel.class, "IngestJobSettingsPanel.fileIngestFilterLabel.text")); // NOI18N + fileIngestFilterComboBox.setModel(new DefaultComboBoxModel<>(controller.getComboBoxContents())); + fileIngestFilterComboBox.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + fileIngestFilterComboBoxActionPerformed(evt); + } + }); + + setMaximumSize(new java.awt.Dimension(5750, 3000)); setMinimumSize(new java.awt.Dimension(0, 0)); setPreferredSize(new java.awt.Dimension(625, 450)); @@ -397,7 +406,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { dialog.pack(); dialog.setVisible(true); }//GEN-LAST:event_pastJobsButtonActionPerformed - + /** * Perform the appropriate action when Jcombobox items are selected, most * notably opening the File filter settings when Create New is chosen. @@ -425,7 +434,6 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { } }//GEN-LAST:event_jComboBox1ActionPerformed - private void SelectAllModules(boolean set) { for (IngestModuleModel module : modules) { module.setEnabled(set); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestTasksScheduler.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestTasksScheduler.java index 0f71cae4fb..c13d9ee8bd 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestTasksScheduler.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestTasksScheduler.java @@ -397,13 +397,6 @@ final class IngestTasksScheduler { private static boolean shouldEnqueueFileTask(final FileIngestTask task) { final AbstractFile file = task.getFile(); - // Skip the task if the file is an unallocated space file and the - // process unallocated space flag is not set for this job. - if (!task.getIngestJob().shouldProcessUnallocatedSpace() - && file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)) { - return false; - } - // Skip the task if the file is actually the pseudo-file for the parent // or current directory. String fileName = file.getName(); @@ -411,6 +404,11 @@ final class IngestTasksScheduler { return false; } + /** + * Check if the file is a member of the file ingest filter that is being + * applied to the current run of ingest, checks if unallocated space + * should be processed inside call to fileIsMemberOf + */ if ((task.getIngestJob().getFileIngestFilter().fileIsMemberOf(file)) == null) { return false; } diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSet.java b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSet.java index 6a0a74b80e..56db222bde 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSet.java +++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSet.java @@ -544,11 +544,13 @@ public final class FilesSet implements Serializable { return file.getMetaType() == TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_REG; case DIRECTORIES: return file.getMetaType() == TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR; - case ALL: - return true; - default: + case FILES_AND_DIRECTORIES: return file.getMetaType() == TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_REG || file.getMetaType() == TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR; + case ALL: + return true; //Effectively ignores the metatype condition when All is selected. + default: + return true; } }