Added XML file save to HasDb.openDatabase()

This commit is contained in:
Richard Cordovano 2013-10-29 18:43:27 -04:00
parent 934463bd7d
commit 58ce29be25
2 changed files with 5 additions and 3 deletions

View File

@ -85,12 +85,14 @@ public class HashDb implements Comparable<HashDb> {
}
static private void addToXMLFile(HashDb database) {
HashDbXML xmlFileManager = HashDbXML.getCurrent();
if (database.getDbType() == HashDb.DBType.NSRL) {
HashDbXML.getCurrent().setNSRLSet(database);
xmlFileManager.setNSRLSet(database);
}
else {
HashDbXML.getCurrent().addKnownBadSet(database);
xmlFileManager.addKnownBadSet(database);
}
xmlFileManager.save();
}
static public List<HashDb> getUpdateableHashDatabases() {

View File

@ -306,7 +306,7 @@ final class HashDbImportDatabaseDialog extends javax.swing.JDialog {
try
{
HashDb db = HashDb.openHashDatabase(databaseNameTextField.getText(), databasePathTextField.getText(), useForIngestCheckbox.isSelected(), sendInboxMessagesCheckbox.isSelected(), type);
HashDb.openHashDatabase(databaseNameTextField.getText(), databasePathTextField.getText(), useForIngestCheckbox.isSelected(), sendInboxMessagesCheckbox.isSelected(), type);
} catch (TskException ex) {
logger.log(Level.WARNING, "Invalid database: ", ex);
JOptionPane.showMessageDialog(this, "Database file you chose cannot be opened.\n" + "If it was just an index, please try to recreate it from the database");