mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 10:17:41 +00:00
Add ability to create empty central repo hash sets.
This commit is contained in:
parent
978a81b29c
commit
ad4e02ed06
@ -96,6 +96,14 @@ public interface EamDb {
|
||||
return EamDbUtil.useCentralRepo()
|
||||
&& EamDbPlatformEnum.getSelectedPlatform() != EamDbPlatformEnum.DISABLED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Placeholder version to use for non-read only databases
|
||||
* @return The version that will be stored in the database
|
||||
*/
|
||||
static String getDefaultVersion() {
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of tags recognized as "Bad"
|
||||
@ -510,7 +518,7 @@ public interface EamDb {
|
||||
* @throws EamDbException
|
||||
*/
|
||||
void addReferenceInstance(EamGlobalFileInstance eamGlobalFileInstance, CorrelationAttribute.Type correlationType) throws EamDbException;
|
||||
|
||||
|
||||
/**
|
||||
* Insert the bulk collection of Global File Instances
|
||||
*
|
||||
|
@ -32,7 +32,6 @@ ModalNoButtons.GO_GET_COFFEE_LABEL.text=Hash databases are currently being index
|
||||
ModalNoButtons.CANCEL_BUTTON.text=Cancel
|
||||
HashDbImportDatabaseDialog.knownRadioButton.text=Known (NSRL or other)
|
||||
HashDbCreateDatabaseDialog.knownRadioButton.text=Known
|
||||
HashDbCreateDatabaseDialog.jLabel1.text=Database Path:
|
||||
HashDbCreateDatabaseDialog.saveAsButton.text=Save As...
|
||||
HashDbCreateDatabaseDialog.hashSetNameTextField.text=
|
||||
HashDbImportDatabaseDialog.jLabel3.text=Database Path:
|
||||
@ -231,6 +230,12 @@ HashDbImportDatabaseDialog.lbOrg.text=Source Organization:
|
||||
HashDbImportDatabaseDialog.readOnlyCheckbox.text=Make database read-only
|
||||
HashDbImportDatabaseDialog.orgButton.text=Manage Organizations
|
||||
HashDbImportDatabaseDialog.versionTextField.text=
|
||||
HashDbImportDatabaseDialog.fileTypeRadioButton.text=File Type
|
||||
HashDbImportDatabaseDialog.fileTypeRadioButton.text=File
|
||||
HashDbImportDatabaseDialog.centralRepoRadioButton.text=Central Repository
|
||||
HashDbImportDatabaseDialog.jLabel4.text=Type:
|
||||
HashDbImportDatabaseDialog.jLabel4.text=Location:
|
||||
HashDbCreateDatabaseDialog.jLabel4.text=Location:
|
||||
HashDbCreateDatabaseDialog.fileTypeRadioButton.text=File
|
||||
HashDbCreateDatabaseDialog.centralRepoRadioButton.text=Central Repository
|
||||
HashDbCreateDatabaseDialog.lbOrg.text=Source Organization:
|
||||
HashDbCreateDatabaseDialog.orgButton.text=Manage Organizations
|
||||
HashDbCreateDatabaseDialog.databasePathLabel.text=Database Path:
|
||||
|
@ -27,7 +27,6 @@ ModalNoButtons.GO_GET_COFFEE_LABEL.text=\u30cf\u30c3\u30b7\u30e5\u30c7\u30fc\u30
|
||||
ModalNoButtons.CANCEL_BUTTON.text=\u30ad\u30e3\u30f3\u30bb\u30eb
|
||||
HashDbImportDatabaseDialog.knownRadioButton.text=\u65e2\u77e5\uff08NSRL\u307e\u305f\u306f\u305d\u306e\u4ed6\uff09
|
||||
HashDbCreateDatabaseDialog.knownRadioButton.text=\u65e2\u77e5
|
||||
HashDbCreateDatabaseDialog.jLabel1.text=\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30d1\u30b9\uff1a
|
||||
HashDbCreateDatabaseDialog.saveAsButton.text=\u540d\u524d\u3092\u3064\u3051\u3066\u4fdd\u5b58\u2026
|
||||
HashDbImportDatabaseDialog.jLabel3.text=\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30d1\u30b9\uff1a
|
||||
HashDbCreateDatabaseDialog.sendIngestMessagesCheckbox.text=\u30d2\u30c3\u30c8\u6bce\u306b\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u30a4\u30f3\u30dc\u30c3\u30af\u30b9\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u308b
|
||||
@ -209,3 +208,4 @@ HashLookupSettingsPanel.hashDbNameLabel.text=\u30c7\u30fc\u30bf\u30d9\u30fc\u30b
|
||||
HashLookupSettingsPanel.nameLabel.text=\u30cf\u30c3\u30b7\u30e5\u30bb\u30c3\u30c8\u540d\uff1a
|
||||
HashLookupSettingsPanel.hashDatabasesLabel.text=\u30cf\u30c3\u30b7\u30e5\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\uff1a
|
||||
HashLookupSettingsPanel.importDatabaseButton.text=\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u30a4\u30f3\u30dd\u30fc\u30c8
|
||||
HashDbCreateDatabaseDialog.databasePathLabel.text=\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30d1\u30b9\uff1a
|
||||
|
@ -4,6 +4,8 @@
|
||||
<NonVisualComponents>
|
||||
<Component class="javax.swing.ButtonGroup" name="buttonGroup1">
|
||||
</Component>
|
||||
<Component class="javax.swing.ButtonGroup" name="storageTypeButtonGroup">
|
||||
</Component>
|
||||
</NonVisualComponents>
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||
@ -27,16 +29,10 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="sendIngestMessagesCheckbox" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="okButton" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="cancelButton" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
|
||||
@ -48,52 +44,92 @@
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="databasePathTextField" max="32767" attributes="0"/>
|
||||
<Component id="lbOrg" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="orgComboBox" min="-2" pref="130" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="orgButton" pref="145" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="hashSetNameTextField" min="-2" pref="272" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="databasePathLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="fileTypeRadioButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
|
||||
<Component id="centralRepoRadioButton" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="hashSetNameTextField" alignment="0" pref="305" max="32767" attributes="0"/>
|
||||
<Component id="databasePathTextField" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="saveAsButton" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="okButton" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="cancelButton" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="fileTypeRadioButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="centralRepoRadioButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="hashSetNameTextField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="databasePathLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="databasePathTextField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="saveAsButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="7" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lbOrg" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="orgComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="orgButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="knownRadioButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="knownBadRadioButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="sendIngestMessagesCheckbox" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="cancelButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="okButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="sendIngestMessagesCheckbox" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="27" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="cancelButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="okButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@ -146,10 +182,10 @@
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="knownBadRadioButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
<Component class="javax.swing.JLabel" name="databasePathLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="HashDbCreateDatabaseDialog.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="HashDbCreateDatabaseDialog.databasePathLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
@ -203,5 +239,69 @@
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="HashDbCreateDatabaseDialog.jLabel4.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="fileTypeRadioButton">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="storageTypeButtonGroup"/>
|
||||
</Property>
|
||||
<Property name="selected" type="boolean" value="true"/>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="HashDbCreateDatabaseDialog.fileTypeRadioButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="fileTypeRadioButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="centralRepoRadioButton">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="storageTypeButtonGroup"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="HashDbCreateDatabaseDialog.centralRepoRadioButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="centralRepoRadioButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lbOrg">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="HashDbCreateDatabaseDialog.lbOrg.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="orgComboBox">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="0"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="orgComboBoxActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="orgButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="HashDbCreateDatabaseDialog.orgButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="orgButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
@ -23,6 +23,7 @@ import java.awt.Toolkit;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JFrame;
|
||||
@ -30,12 +31,18 @@ import javax.swing.JOptionPane;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.windows.WindowManager;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamOrganization;
|
||||
import org.sleuthkit.autopsy.centralrepository.optionspanel.ManageOrganizationsDialog;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb.KnownFilesType;
|
||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDbManagerException;
|
||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDatabase;
|
||||
import org.sleuthkit.datamodel.TskData;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
|
||||
/**
|
||||
* Instances of this class allow a user to create a new hash database and add it
|
||||
@ -49,6 +56,8 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
|
||||
private JFileChooser fileChooser = null;
|
||||
private HashDatabase newHashDb = null;
|
||||
private final static String LAST_FILE_PATH_KEY = "HashDbCreate_Path";
|
||||
private EamOrganization selectedOrg = null;
|
||||
private List<EamOrganization> orgs = null;
|
||||
|
||||
/**
|
||||
* Displays a dialog that allows a user to create a new hash database and
|
||||
@ -59,6 +68,7 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
|
||||
super((JFrame) WindowManager.getDefault().getMainWindow(), NbBundle.getMessage(HashDbCreateDatabaseDialog.class, "HashDbCreateDatabaseDialog.createHashDbMsg"), true);
|
||||
initFileChooser();
|
||||
initComponents();
|
||||
enableComponents();
|
||||
display();
|
||||
}
|
||||
|
||||
@ -112,6 +122,46 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
|
||||
setLocation((screenDimension.width - getSize().width) / 2, (screenDimension.height - getSize().height) / 2);
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
private void enableComponents(){
|
||||
|
||||
if(! EamDb.isEnabled()){
|
||||
centralRepoRadioButton.setEnabled(false);
|
||||
fileTypeRadioButton.setSelected(true);
|
||||
} else {
|
||||
populateCombobox();
|
||||
}
|
||||
|
||||
boolean isFileType = fileTypeRadioButton.isSelected();
|
||||
|
||||
// Type type only
|
||||
databasePathLabel.setEnabled(isFileType);
|
||||
databasePathTextField.setEnabled(isFileType);
|
||||
saveAsButton.setEnabled(isFileType);
|
||||
|
||||
// Central repo only
|
||||
lbOrg.setEnabled(! isFileType);
|
||||
orgButton.setEnabled(! isFileType);
|
||||
orgComboBox.setEnabled(! isFileType);
|
||||
}
|
||||
|
||||
@NbBundle.Messages({"HashDbCreateDatabaseDialog.populateOrgsError.message=Failure loading organizations."})
|
||||
private void populateCombobox() {
|
||||
orgComboBox.removeAllItems();
|
||||
try {
|
||||
EamDb dbManager = EamDb.getInstance();
|
||||
orgs = dbManager.getOrganizations();
|
||||
orgs.forEach((org) -> {
|
||||
orgComboBox.addItem(org.getName());
|
||||
});
|
||||
if (!orgs.isEmpty()) {
|
||||
selectedOrg = orgs.get(0);
|
||||
}
|
||||
} catch (EamDbException ex) {
|
||||
JOptionPane.showMessageDialog(null, Bundle.HashDbCreateDatabaseDialog_populateOrgsError_message());
|
||||
Logger.getLogger(ImportCentralRepoDbProgressDialog.class.getName()).log(Level.SEVERE, "Failure loading organizations", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
@ -123,17 +173,24 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
|
||||
private void initComponents() {
|
||||
|
||||
buttonGroup1 = new javax.swing.ButtonGroup();
|
||||
storageTypeButtonGroup = new javax.swing.ButtonGroup();
|
||||
saveAsButton = new javax.swing.JButton();
|
||||
cancelButton = new javax.swing.JButton();
|
||||
knownRadioButton = new javax.swing.JRadioButton();
|
||||
knownBadRadioButton = new javax.swing.JRadioButton();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
databasePathLabel = new javax.swing.JLabel();
|
||||
hashSetNameTextField = new javax.swing.JTextField();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
sendIngestMessagesCheckbox = new javax.swing.JCheckBox();
|
||||
jLabel3 = new javax.swing.JLabel();
|
||||
databasePathTextField = new javax.swing.JTextField();
|
||||
okButton = new javax.swing.JButton();
|
||||
jLabel4 = new javax.swing.JLabel();
|
||||
fileTypeRadioButton = new javax.swing.JRadioButton();
|
||||
centralRepoRadioButton = new javax.swing.JRadioButton();
|
||||
lbOrg = new javax.swing.JLabel();
|
||||
orgComboBox = new javax.swing.JComboBox<>();
|
||||
orgButton = new javax.swing.JButton();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
@ -168,7 +225,7 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
|
||||
}
|
||||
});
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class, "HashDbCreateDatabaseDialog.jLabel1.text")); // NOI18N
|
||||
org.openide.awt.Mnemonics.setLocalizedText(databasePathLabel, org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class, "HashDbCreateDatabaseDialog.databasePathLabel.text")); // NOI18N
|
||||
|
||||
hashSetNameTextField.setText(org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class, "HashDbCreateDatabaseDialog.hashSetNameTextField.text")); // NOI18N
|
||||
|
||||
@ -194,6 +251,40 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
|
||||
}
|
||||
});
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class, "HashDbCreateDatabaseDialog.jLabel4.text")); // NOI18N
|
||||
|
||||
storageTypeButtonGroup.add(fileTypeRadioButton);
|
||||
fileTypeRadioButton.setSelected(true);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(fileTypeRadioButton, org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class, "HashDbCreateDatabaseDialog.fileTypeRadioButton.text")); // NOI18N
|
||||
fileTypeRadioButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
fileTypeRadioButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
storageTypeButtonGroup.add(centralRepoRadioButton);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(centralRepoRadioButton, org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class, "HashDbCreateDatabaseDialog.centralRepoRadioButton.text")); // NOI18N
|
||||
centralRepoRadioButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
centralRepoRadioButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(lbOrg, org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class, "HashDbCreateDatabaseDialog.lbOrg.text")); // NOI18N
|
||||
|
||||
orgComboBox.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
orgComboBoxActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(orgButton, org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class, "HashDbCreateDatabaseDialog.orgButton.text")); // NOI18N
|
||||
orgButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
orgButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
@ -202,11 +293,6 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(sendIngestMessagesCheckbox)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(okButton)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(cancelButton))
|
||||
.addComponent(jLabel2)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(20, 20, 20)
|
||||
@ -216,15 +302,32 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(databasePathTextField))
|
||||
.addComponent(lbOrg)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(orgComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(orgButton, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addComponent(jLabel3)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(hashSetNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 272, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel3)
|
||||
.addComponent(jLabel4)
|
||||
.addComponent(databasePathLabel))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(fileTypeRadioButton)
|
||||
.addGap(22, 22, 22)
|
||||
.addComponent(centralRepoRadioButton))
|
||||
.addComponent(hashSetNameTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 305, Short.MAX_VALUE)
|
||||
.addComponent(databasePathTextField))))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(saveAsButton)))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(okButton)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(cancelButton)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
@ -232,29 +335,43 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
|
||||
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGap(2, 2, 2)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel4)
|
||||
.addComponent(fileTypeRadioButton)
|
||||
.addComponent(centralRepoRadioButton))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel3)
|
||||
.addComponent(hashSetNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(databasePathLabel)
|
||||
.addComponent(databasePathTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(saveAsButton)
|
||||
.addComponent(jLabel1))
|
||||
.addGap(7, 7, 7)
|
||||
.addComponent(saveAsButton))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(lbOrg)
|
||||
.addComponent(orgComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(orgButton))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel2)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(knownRadioButton)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(knownBadRadioButton)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(sendIngestMessagesCheckbox)
|
||||
.addGap(26, 26, 26)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(okButton))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(sendIngestMessagesCheckbox)
|
||||
.addGap(0, 27, Short.MAX_VALUE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(okButton))))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
pack();
|
||||
@ -304,6 +421,11 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
|
||||
}
|
||||
}//GEN-LAST:event_saveAsButtonActionPerformed
|
||||
|
||||
@NbBundle.Messages({"HashDbCreateDatabaseDialog.missingOrg=An organization must be selected",
|
||||
"HashDbCreateDatabaseDialog.duplicateName=A hashset with this name and version already exists",
|
||||
"HashDbCreateDatabaseDialog.databaseLookupError=Error accessing central repository",
|
||||
"HashDbCreateDatabaseDialog.databaseCreationError=Error creating new hash set"
|
||||
})
|
||||
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
|
||||
// Note that the error handlers in this method call return without disposing of the
|
||||
// dialog to allow the user to try again, if desired.
|
||||
@ -318,44 +440,100 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
|
||||
return;
|
||||
}
|
||||
|
||||
if (databasePathTextField.getText().isEmpty()) {
|
||||
JOptionPane.showMessageDialog(this,
|
||||
if(fileTypeRadioButton.isSelected()){
|
||||
if (databasePathTextField.getText().isEmpty()) {
|
||||
JOptionPane.showMessageDialog(this,
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.mustEnterHashDbPathMsg"),
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.createHashDbErr"),
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if(selectedOrg == null){
|
||||
JOptionPane.showMessageDialog(this,
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.mustEnterHashDbPathMsg"),
|
||||
"HashDbCreateDatabaseDialog.missingOrg"),
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.createHashDbErr"),
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
KnownFilesType type;
|
||||
TskData.FileKnown fileKnown;
|
||||
if (knownRadioButton.isSelected()) {
|
||||
type = KnownFilesType.KNOWN;
|
||||
fileKnown = TskData.FileKnown.KNOWN;
|
||||
} else {
|
||||
type = KnownFilesType.KNOWN_BAD;
|
||||
fileKnown = TskData.FileKnown.BAD;
|
||||
}
|
||||
|
||||
String errorMessage = NbBundle
|
||||
.getMessage(this.getClass(), "HashDbCreateDatabaseDialog.errMsg.hashDbCreationErr");
|
||||
try {
|
||||
newHashDb = HashDbManager.getInstance().addNewFileTypeHashDatabase(hashSetNameTextField.getText(), fileChooser.getSelectedFile().getCanonicalPath(), true, sendIngestMessagesCheckbox.isSelected(), type);
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(HashDbCreateDatabaseDialog.class.getName()).log(Level.WARNING, errorMessage, ex);
|
||||
JOptionPane.showMessageDialog(this,
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.cannotCreateFileAtLocMsg"),
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.createHashDbErr"),
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
} catch (HashDbManagerException ex) {
|
||||
Logger.getLogger(HashDbCreateDatabaseDialog.class.getName()).log(Level.WARNING, errorMessage, ex);
|
||||
JOptionPane.showMessageDialog(this,
|
||||
ex.getMessage(),
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.createHashDbErr"),
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
if(fileTypeRadioButton.isSelected()){
|
||||
try {
|
||||
newHashDb = HashDbManager.getInstance().addNewFileTypeHashDatabase(hashSetNameTextField.getText(), fileChooser.getSelectedFile().getCanonicalPath(), true, sendIngestMessagesCheckbox.isSelected(), type);
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(HashDbCreateDatabaseDialog.class.getName()).log(Level.WARNING, errorMessage, ex);
|
||||
JOptionPane.showMessageDialog(this,
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.cannotCreateFileAtLocMsg"),
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.createHashDbErr"),
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
} catch (HashDbManagerException ex) {
|
||||
Logger.getLogger(HashDbCreateDatabaseDialog.class.getName()).log(Level.WARNING, errorMessage, ex);
|
||||
JOptionPane.showMessageDialog(this,
|
||||
ex.getMessage(),
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.createHashDbErr"),
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Check if a hash set with the same name/version already exists
|
||||
try{
|
||||
if(EamDb.getInstance().referenceSetExists(hashSetNameTextField.getText(), EamDb.getDefaultVersion())){
|
||||
JOptionPane.showMessageDialog(this,
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.duplicateName"),
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.createHashDbErr"),
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
} catch (EamDbException ex){
|
||||
Logger.getLogger(HashDbImportDatabaseDialog.class.getName()).log(Level.SEVERE, "Error looking up reference set", ex);
|
||||
JOptionPane.showMessageDialog(this,
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.databaseLookupError"),
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.createHashDbErr"),
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
try{
|
||||
int crIndex = EamDb.getInstance().newReferenceSet(selectedOrg.getOrgID(), hashSetNameTextField.getText(),
|
||||
EamDb.getDefaultVersion(), fileKnown, false);
|
||||
newHashDb = HashDbManager.getInstance().addExistingCentralRepoHashSet(hashSetNameTextField.getText(),
|
||||
EamDb.getDefaultVersion(), crIndex,
|
||||
true, sendIngestMessagesCheckbox.isSelected(), type, false);
|
||||
} catch (EamDbException | TskCoreException ex){
|
||||
Logger.getLogger(HashDbImportDatabaseDialog.class.getName()).log(Level.SEVERE, "Error creating new reference set", ex);
|
||||
JOptionPane.showMessageDialog(this,
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.databaseCreationError"),
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbCreateDatabaseDialog.createHashDbErr"),
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
dispose();
|
||||
@ -365,18 +543,52 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_sendIngestMessagesCheckboxActionPerformed
|
||||
|
||||
private void orgButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_orgButtonActionPerformed
|
||||
ManageOrganizationsDialog dialog = new ManageOrganizationsDialog();
|
||||
// update the combobox options
|
||||
if (dialog.isChanged()) {
|
||||
populateCombobox();
|
||||
}
|
||||
}//GEN-LAST:event_orgButtonActionPerformed
|
||||
|
||||
private void orgComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_orgComboBoxActionPerformed
|
||||
if (null == orgComboBox.getSelectedItem()) return;
|
||||
String orgName = this.orgComboBox.getSelectedItem().toString();
|
||||
for (EamOrganization org : orgs) {
|
||||
if (org.getName().equals(orgName)) {
|
||||
selectedOrg = org;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}//GEN-LAST:event_orgComboBoxActionPerformed
|
||||
|
||||
private void fileTypeRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fileTypeRadioButtonActionPerformed
|
||||
enableComponents();
|
||||
}//GEN-LAST:event_fileTypeRadioButtonActionPerformed
|
||||
|
||||
private void centralRepoRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_centralRepoRadioButtonActionPerformed
|
||||
enableComponents();
|
||||
}//GEN-LAST:event_centralRepoRadioButtonActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.ButtonGroup buttonGroup1;
|
||||
private javax.swing.JButton cancelButton;
|
||||
private javax.swing.JRadioButton centralRepoRadioButton;
|
||||
private javax.swing.JLabel databasePathLabel;
|
||||
private javax.swing.JTextField databasePathTextField;
|
||||
private javax.swing.JRadioButton fileTypeRadioButton;
|
||||
private javax.swing.JTextField hashSetNameTextField;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel3;
|
||||
private javax.swing.JLabel jLabel4;
|
||||
private javax.swing.JRadioButton knownBadRadioButton;
|
||||
private javax.swing.JRadioButton knownRadioButton;
|
||||
private javax.swing.JLabel lbOrg;
|
||||
private javax.swing.JButton okButton;
|
||||
private javax.swing.JButton orgButton;
|
||||
private javax.swing.JComboBox<String> orgComboBox;
|
||||
private javax.swing.JButton saveAsButton;
|
||||
private javax.swing.JCheckBox sendIngestMessagesCheckbox;
|
||||
private javax.swing.ButtonGroup storageTypeButtonGroup;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
|
@ -304,6 +304,9 @@
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="HashDbImportDatabaseDialog.readOnlyCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="readOnlyCheckboxActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="fileTypeRadioButton">
|
||||
<Properties>
|
||||
|
@ -25,7 +25,6 @@ import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JOptionPane;
|
||||
@ -36,7 +35,6 @@ import org.openide.windows.WindowManager;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamOrganization;
|
||||
import org.sleuthkit.autopsy.centralrepository.optionspanel.AddNewOrganizationDialog;
|
||||
import org.sleuthkit.autopsy.centralrepository.optionspanel.ManageOrganizationsDialog;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||
@ -120,8 +118,9 @@ final class HashDbImportDatabaseDialog extends javax.swing.JDialog {
|
||||
boolean isFileType = fileTypeRadioButton.isSelected();
|
||||
|
||||
// Central repo only
|
||||
lbVersion.setEnabled(! isFileType);
|
||||
versionTextField.setEnabled(! isFileType);
|
||||
lbVersion.setEnabled((! isFileType) && (readOnlyCheckbox.isSelected()));
|
||||
versionTextField.setEnabled((! isFileType) && (readOnlyCheckbox.isSelected()));
|
||||
|
||||
lbOrg.setEnabled(! isFileType);
|
||||
orgButton.setEnabled(! isFileType);
|
||||
orgComboBox.setEnabled(! isFileType);
|
||||
@ -258,6 +257,11 @@ final class HashDbImportDatabaseDialog extends javax.swing.JDialog {
|
||||
|
||||
readOnlyCheckbox.setSelected(true);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(readOnlyCheckbox, org.openide.util.NbBundle.getMessage(HashDbImportDatabaseDialog.class, "HashDbImportDatabaseDialog.readOnlyCheckbox.text")); // NOI18N
|
||||
readOnlyCheckbox.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
readOnlyCheckboxActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
storageTypeButtonGroup.add(fileTypeRadioButton);
|
||||
fileTypeRadioButton.setSelected(true);
|
||||
@ -534,10 +538,17 @@ final class HashDbImportDatabaseDialog extends javax.swing.JDialog {
|
||||
return;
|
||||
}
|
||||
|
||||
String version;
|
||||
if(readOnlyCheckbox.isSelected()){
|
||||
version = versionTextField.getText();
|
||||
} else {
|
||||
// Editable databases don't have a version
|
||||
version = EamDb.getDefaultVersion();
|
||||
}
|
||||
ImportCentralRepoDbProgressDialog progressDialog = new ImportCentralRepoDbProgressDialog();
|
||||
progressDialog.importFile(hashSetNameTextField.getText(), versionTextField.getText(),
|
||||
progressDialog.importFile(hashSetNameTextField.getText(), version,
|
||||
selectedOrg.getOrgID(), true, sendIngestMessagesCheckbox.isSelected(), type,
|
||||
this.readOnlyCheckbox.isSelected(), selectedFilePath);
|
||||
readOnlyCheckbox.isSelected(), selectedFilePath);
|
||||
selectedHashDb = progressDialog.getDatabase();
|
||||
}
|
||||
|
||||
@ -565,9 +576,6 @@ final class HashDbImportDatabaseDialog extends javax.swing.JDialog {
|
||||
}//GEN-LAST:event_orgButtonActionPerformed
|
||||
|
||||
private void orgComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_orgComboBoxActionPerformed
|
||||
//JComboBox<String> cb = (JComboBox<String>)evt.getSource();
|
||||
//String orgName = (String)cb.getSelectedItem();
|
||||
|
||||
if (null == orgComboBox.getSelectedItem()) return;
|
||||
String orgName = this.orgComboBox.getSelectedItem().toString();
|
||||
for (EamOrganization org : orgs) {
|
||||
@ -578,6 +586,10 @@ final class HashDbImportDatabaseDialog extends javax.swing.JDialog {
|
||||
}
|
||||
}//GEN-LAST:event_orgComboBoxActionPerformed
|
||||
|
||||
private void readOnlyCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_readOnlyCheckboxActionPerformed
|
||||
enableComponents();
|
||||
}//GEN-LAST:event_readOnlyCheckboxActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.ButtonGroup buttonGroup1;
|
||||
private javax.swing.JButton cancelButton;
|
||||
|
@ -1213,7 +1213,11 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
|
||||
@Override
|
||||
public String getDisplayName(){
|
||||
return getHashSetName() + " " + getVersion();
|
||||
if(! getVersion().isEmpty()){
|
||||
return getHashSetName() + " " + getVersion() + " (remote)";
|
||||
} else {
|
||||
return getHashSetName() + " (remote)";
|
||||
}
|
||||
}
|
||||
|
||||
public String getVersion(){
|
||||
|
@ -494,7 +494,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
||||
|
||||
@Override
|
||||
public Object getValueAt(int rowIndex, int columnIndex) {
|
||||
return hashSets.get(rowIndex).getHashSetName();
|
||||
return hashSets.get(rowIndex).getDisplayName();
|
||||
}
|
||||
|
||||
private boolean isValid(int rowIndex) {
|
||||
@ -921,6 +921,11 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
||||
private void createDatabaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createDatabaseButtonActionPerformed
|
||||
HashDatabase hashDb = new HashDbCreateDatabaseDialog().getHashDatabase();
|
||||
if (null != hashDb) {
|
||||
if(hashDb instanceof CentralRepoHashDb){
|
||||
int newDbIndex = ((CentralRepoHashDb)hashDb).getCentralRepoIndex();
|
||||
newCentralRepoIndices.add(newDbIndex);
|
||||
}
|
||||
|
||||
hashSetTableModel.refreshModel();
|
||||
((HashSetTable) hashSetTable).selectRowByDatabase(hashDb);
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
|
Loading…
x
Reference in New Issue
Block a user