diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/Bundle.properties b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/Bundle.properties index 76895be76a..9681229663 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/Bundle.properties @@ -21,7 +21,7 @@ FileExtMismatchConfigPanel.removeExtButton.noneSelected=No extension selected\! FileExtMismatchConfigPanel.removeExtButton.noMimeTypeSelected=No MIME type selected\! FileExtMismatchConfigPanel.removeExtButton.deleted=Extension {0} deleted. FileExtMismatchConfigPanel.store.msg=Saved. -FileExtMismatchConfigPanel.store.msgDlg.msg=Writing XML configuration file failed. +FileExtMismatchConfigPanel.store.msgDlg.msg=Writing configuration file failed. FileExtMismatchConfigPanel.save.msgDlg.title=Save Error FileExtMismatchConfigPanel.ok.confDlg.msg=Would you like to save configuration changes? FileExtMismatchConfigPanel.confDlg.title=Unsaved Changes diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchSettingsPanel.java index 92788d2308..2eea561575 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchSettingsPanel.java @@ -583,8 +583,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel // Load the configuration into a buffer that the user can modify. They can choose // to save it back to the file after making changes. editableMap = FileExtMismatchXML.getDefault().load(); - updateMimeList(); - updateExtList(); + } catch (FileExtMismatchXML.FileExtMismatchException ex) { //error JOptionPane.showMessageDialog(this, @@ -594,6 +593,8 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel "FileExtMismatchConfigPanel.save.msgDlg.title"), JOptionPane.ERROR_MESSAGE); } + updateMimeList(); + updateExtList(); } @Override diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchXML.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchXML.java index fc3cc01336..630bc6add5 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchXML.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchXML.java @@ -90,9 +90,7 @@ class FileExtMismatchXML { * * @return Loaded hash map or null on error or null if data does not exist */ - public HashMap load() throws FileExtMismatchException { - throw new FileExtMismatchException(""); - /*HashMap sigTypeToExtMap = new HashMap<>(); + public HashMap load() throws FileExtMismatchException {HashMap sigTypeToExtMap = new HashMap<>(); File serializedFile = new File(DEFAULT_SERIALIZED_FILE_PATH); if (serializedFile.exists()) { try { @@ -148,7 +146,7 @@ class FileExtMismatchXML { logger.log(Level.SEVERE, "Error loading config file.", e); //NON-NLS return null; } - return sigTypeToExtMap;*/ + return sigTypeToExtMap; } /** @@ -160,14 +158,13 @@ class FileExtMismatchXML { * @return Loaded hash map or null on error or null if data does not exist */ public boolean save(HashMap sigTypeToExtMap) throws FileExtMismatchException { - throw new FileExtMismatchException(""); - /*try (NbObjectOutputStream out = new NbObjectOutputStream(new FileOutputStream(DEFAULT_SERIALIZED_FILE_PATH))) { + try (NbObjectOutputStream out = new NbObjectOutputStream(new FileOutputStream(DEFAULT_SERIALIZED_FILE_PATH))) { FileExtMismatchSettings settings = new FileExtMismatchSettings(sigTypeToExtMap); out.writeObject(settings); return true; } catch (IOException ex) { throw new FileExtMismatchException(String.format("Failed to write settings to %s", DEFAULT_SERIALIZED_FILE_PATH), ex); - }*/ + } } /**