diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FileIngestFilterDefsOptionsPanelController.java b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FileIngestFilterDefsOptionsPanelController.java index c2ae276a17..998c734418 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FileIngestFilterDefsOptionsPanelController.java +++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FileIngestFilterDefsOptionsPanelController.java @@ -65,22 +65,23 @@ public final class FileIngestFilterDefsOptionsPanelController extends OptionsPan /** * Returns an array which will contain the names of all options which should * exist in the "Run Ingest Modules On:" JCombobox + * + * Keeping the default File Ingest Filters and the saved one seperate allows + * the default to always be first elements in * * @return -filterNames an array of all established filter names as well as * a Create New option */ public String[] getComboBoxContents() { - ArrayList nameList = new ArrayList<>(); - if (!(panel == null)) { - try { - nameList.addAll(FilesSetsManager.getInstance().getFileIngestFiltersWithDefaults().keySet()); - } catch (FilesSetsManager.FilesSetsManagerException ex) { - LOGGER.log(Level.SEVERE, "Failed to get File Ingest Filters for population of of combo box.", ex); //NON-NLS - } - } + ArrayList nameList = new ArrayList<>(); + for (FilesSet fSet : IngestJobSettings.getStandardFileIngestFilters()) { + nameList.add(fSet.getName()); + } nameList.add(NEW_INGEST_FILTER); - String[] returnArray = {}; - return nameList.toArray(returnArray); + if (!(panel == null)) { + nameList.addAll(panel.getKeys()); + } + return nameList.toArray(new String[nameList.size()]); } /** diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetDefsPanel.java b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetDefsPanel.java index 22937bd97b..d81d69f46a 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetDefsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetDefsPanel.java @@ -100,11 +100,15 @@ final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel implements this.ruleDialogTitle = "FilesSetPanel.interesting.title"; this.jTextArea1.setText(org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.interesting.jTextArea1.text")); // NOI18N } - } + Set getKeys() { + load(); + return filesSets.keySet(); + } + @NbBundle.Messages({"FilesSetDefsPanel.Interesting.Title=Global Interesting Items Settings", - "FilesSetDefsPanel.Ingest.Title=Global Ingest Filter Settings"}) + "FilesSetDefsPanel.Ingest.Title=File Ingest Filter Settings"}) private void customInit() { if (panelType == PANEL_TYPE.FILE_INGEST_FILTERS) { setName(Bundle.FilesSetDefsPanel_Ingest_Title()); diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetPanel.java b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetPanel.java index 6b503d71ec..06294fd860 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetPanel.java +++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetPanel.java @@ -74,7 +74,8 @@ public class FilesSetPanel extends javax.swing.JPanel { * @return A name string. */ String getFilesSetName() { - return this.nameTextField.getText(); + String returnValue = this.nameTextField.getText(); + return returnValue; } /** diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetsManager.java b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetsManager.java index add47187b3..b257e692e1 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetsManager.java +++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetsManager.java @@ -123,32 +123,34 @@ public final class FilesSetsManager extends Observable { } /** - * Gets a copy of the current ingest file set definitions with the default values. + * Gets a copy of the current ingest file set definitions with the default + * values. * * @return A map of FilesSet names to file ingest sets, possibly empty. */ public Map getFileIngestFiltersWithDefaults() throws FilesSetsManagerException { - synchronized (FILE_INGEST_FILTER_LOCK) { - Map returnMap = new HashMap<>(); - returnMap.putAll(getFileIngestFilters()); + Map returnMap = new HashMap<>(); for (FilesSet fSet : IngestJobSettings.getStandardFileIngestFilters()) { returnMap.put(fSet.getName(), fSet); } + returnMap.putAll(getFileIngestFilters()); return returnMap; - } } - + /** * Gets a copy of the current ingest file set definitions. - * - * The defaults are not included so that they will not show up in the editor. + * + * The defaults are not included so that they will not show up in the + * editor. * * @return A map of FilesSet names to file ingest sets, possibly empty. */ Map getFileIngestFilters() throws FilesSetsManagerException { - return FilesSetXML.readDefinitionsFile(getFileIngestFilterDefsName(), ""); + synchronized (FILE_INGEST_FILTER_LOCK) { + return FilesSetXML.readDefinitionsFile(getFileIngestFilterDefsName(), ""); + } } - + /** * Sets the current interesting file sets definitions, replacing any * previous definitions.