19 package org.sleuthkit.autopsy.modules.hashdatabase;
22 import java.io.IOException;
23 import java.nio.file.Paths;
24 import java.util.List;
25 import java.util.logging.Level;
26 import javax.swing.JFileChooser;
27 import javax.swing.JFrame;
28 import javax.swing.JOptionPane;
29 import org.apache.commons.io.FilenameUtils;
30 import org.openide.util.NbBundle;
31 import org.openide.windows.WindowManager;
53 final class HashDbCreateDatabaseDialog
extends javax.swing.JDialog {
55 private static final String DEFAULT_FILE_NAME = NbBundle
56 .getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.defaultFileName");
57 private JFileChooser fileChooser = null;
58 private HashDb newHashDb = null;
59 private final static String LAST_FILE_PATH_KEY =
"HashDbCreate_Path";
60 private EamOrganization selectedOrg = null;
61 private List<EamOrganization> orgs = null;
68 HashDbCreateDatabaseDialog() {
69 super((JFrame) WindowManager.getDefault().getMainWindow(), NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.createHashDbMsg"),
true);
81 HashDb getHashDatabase() {
85 private void initFileChooser() {
86 fileChooser =
new JFileChooser() {
88 public void approveSelection() {
89 File selectedFile = getSelectedFile();
90 if (!FilenameUtils.getExtension(selectedFile.getName()).equalsIgnoreCase(HashDbManager.getHashDatabaseFileExtension())) {
91 if (JOptionPane.showConfirmDialog(
this,
92 NbBundle.getMessage(
this.getClass(),
93 "HashDbCreateDatabaseDialog.hashDbMustHaveFileExtensionMsg",
94 HashDbManager.getHashDatabaseFileExtension()),
95 NbBundle.getMessage(
this.getClass(),
96 "HashDbCreateDatabaseDialog.fileNameErr"),
97 JOptionPane.OK_CANCEL_OPTION) == JOptionPane.CANCEL_OPTION) {
102 if (selectedFile.exists()) {
103 if (JOptionPane.showConfirmDialog(
this,
104 NbBundle.getMessage(
this.getClass(),
105 "HashDbCreateDatabaseDialog.fileNameAlreadyExistsMsg"),
106 NbBundle.getMessage(
this.getClass(),
107 "HashDbCreateDatabaseDialog.fileExistsErr"),
108 JOptionPane.OK_CANCEL_OPTION) == JOptionPane.CANCEL_OPTION) {
113 super.approveSelection();
116 fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
117 fileChooser.setDragEnabled(
false);
118 fileChooser.setMultiSelectionEnabled(
false);
121 private void display() {
122 setLocationRelativeTo(getOwner());
126 private void enableComponents(){
128 if(! EamDb.isEnabled()){
129 centralRepoRadioButton.setEnabled(
false);
130 fileTypeRadioButton.setSelected(
true);
135 boolean isFileType = fileTypeRadioButton.isSelected();
138 databasePathLabel.setEnabled(isFileType);
139 databasePathTextField.setEnabled(isFileType);
140 saveAsButton.setEnabled(isFileType);
143 lbOrg.setEnabled(! isFileType);
144 orgButton.setEnabled(! isFileType);
145 orgComboBox.setEnabled(! isFileType);
148 @NbBundle.Messages({
"HashDbCreateDatabaseDialog.populateOrgsError.message=Failure loading organizations."})
149 private void populateCombobox() {
150 orgComboBox.removeAllItems();
152 EamDb dbManager = EamDb.getInstance();
153 orgs = dbManager.getOrganizations();
154 orgs.forEach((
org) -> {
155 orgComboBox.addItem(
org.getName());
156 if(EamDbUtil.isDefaultOrg(
org)){
157 orgComboBox.setSelectedItem(
org.getName());
161 if ((selectedOrg == null) && (!orgs.isEmpty())) {
162 selectedOrg = orgs.get(0);
164 }
catch (EamDbException ex) {
165 JOptionPane.showMessageDialog(
this, Bundle.HashDbCreateDatabaseDialog_populateOrgsError_message());
166 Logger.getLogger(ImportCentralRepoDbProgressDialog.class.getName()).log(Level.SEVERE,
"Failure loading organizations", ex);
175 @SuppressWarnings(
"unchecked")
177 private
void initComponents() {
179 buttonGroup1 =
new javax.swing.ButtonGroup();
180 storageTypeButtonGroup =
new javax.swing.ButtonGroup();
181 saveAsButton =
new javax.swing.JButton();
182 cancelButton =
new javax.swing.JButton();
183 knownRadioButton =
new javax.swing.JRadioButton();
184 knownBadRadioButton =
new javax.swing.JRadioButton();
185 databasePathLabel =
new javax.swing.JLabel();
186 hashSetNameTextField =
new javax.swing.JTextField();
187 jLabel2 =
new javax.swing.JLabel();
188 sendIngestMessagesCheckbox =
new javax.swing.JCheckBox();
189 jLabel3 =
new javax.swing.JLabel();
190 databasePathTextField =
new javax.swing.JTextField();
191 okButton =
new javax.swing.JButton();
192 jLabel4 =
new javax.swing.JLabel();
193 fileTypeRadioButton =
new javax.swing.JRadioButton();
194 centralRepoRadioButton =
new javax.swing.JRadioButton();
195 lbOrg =
new javax.swing.JLabel();
196 orgComboBox =
new javax.swing.JComboBox<>();
197 orgButton =
new javax.swing.JButton();
199 setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
201 org.openide.awt.Mnemonics.setLocalizedText(saveAsButton,
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.saveAsButton.text"));
202 saveAsButton.addActionListener(
new java.awt.event.ActionListener() {
203 public void actionPerformed(java.awt.event.ActionEvent evt) {
204 saveAsButtonActionPerformed(evt);
208 org.openide.awt.Mnemonics.setLocalizedText(cancelButton,
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.cancelButton.text"));
209 cancelButton.addActionListener(
new java.awt.event.ActionListener() {
210 public void actionPerformed(java.awt.event.ActionEvent evt) {
211 cancelButtonActionPerformed(evt);
215 buttonGroup1.add(knownRadioButton);
216 org.openide.awt.Mnemonics.setLocalizedText(knownRadioButton,
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.knownRadioButton.text"));
217 knownRadioButton.addActionListener(
new java.awt.event.ActionListener() {
218 public void actionPerformed(java.awt.event.ActionEvent evt) {
219 knownRadioButtonActionPerformed(evt);
223 buttonGroup1.add(knownBadRadioButton);
224 knownBadRadioButton.setSelected(
true);
225 org.openide.awt.Mnemonics.setLocalizedText(knownBadRadioButton,
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.knownBadRadioButton.text"));
226 knownBadRadioButton.addActionListener(
new java.awt.event.ActionListener() {
227 public void actionPerformed(java.awt.event.ActionEvent evt) {
228 knownBadRadioButtonActionPerformed(evt);
232 org.openide.awt.Mnemonics.setLocalizedText(databasePathLabel,
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.databasePathLabel.text"));
234 hashSetNameTextField.setText(
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.hashSetNameTextField.text"));
236 org.openide.awt.Mnemonics.setLocalizedText(jLabel2,
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.jLabel2.text"));
238 sendIngestMessagesCheckbox.setSelected(
true);
239 org.openide.awt.Mnemonics.setLocalizedText(sendIngestMessagesCheckbox,
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.sendIngestMessagesCheckbox.text"));
240 sendIngestMessagesCheckbox.addActionListener(
new java.awt.event.ActionListener() {
241 public void actionPerformed(java.awt.event.ActionEvent evt) {
242 sendIngestMessagesCheckboxActionPerformed(evt);
246 org.openide.awt.Mnemonics.setLocalizedText(jLabel3,
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.jLabel3.text"));
248 databasePathTextField.setEditable(
false);
249 databasePathTextField.setText(
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.databasePathTextField.text"));
251 org.openide.awt.Mnemonics.setLocalizedText(okButton,
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.okButton.text"));
252 okButton.addActionListener(
new java.awt.event.ActionListener() {
253 public void actionPerformed(java.awt.event.ActionEvent evt) {
254 okButtonActionPerformed(evt);
258 org.openide.awt.Mnemonics.setLocalizedText(jLabel4,
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.jLabel4.text"));
260 storageTypeButtonGroup.add(fileTypeRadioButton);
261 fileTypeRadioButton.setSelected(
true);
262 org.openide.awt.Mnemonics.setLocalizedText(fileTypeRadioButton,
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.fileTypeRadioButton.text"));
263 fileTypeRadioButton.addActionListener(
new java.awt.event.ActionListener() {
264 public void actionPerformed(java.awt.event.ActionEvent evt) {
265 fileTypeRadioButtonActionPerformed(evt);
269 storageTypeButtonGroup.add(centralRepoRadioButton);
270 org.openide.awt.Mnemonics.setLocalizedText(centralRepoRadioButton,
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.centralRepoRadioButton.text"));
271 centralRepoRadioButton.addActionListener(
new java.awt.event.ActionListener() {
272 public void actionPerformed(java.awt.event.ActionEvent evt) {
273 centralRepoRadioButtonActionPerformed(evt);
277 org.openide.awt.Mnemonics.setLocalizedText(lbOrg,
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.lbOrg.text"));
279 orgComboBox.addActionListener(
new java.awt.event.ActionListener() {
280 public void actionPerformed(java.awt.event.ActionEvent evt) {
281 orgComboBoxActionPerformed(evt);
285 org.openide.awt.Mnemonics.setLocalizedText(orgButton,
org.openide.util.NbBundle.getMessage(HashDbCreateDatabaseDialog.class,
"HashDbCreateDatabaseDialog.orgButton.text"));
286 orgButton.addActionListener(
new java.awt.event.ActionListener() {
287 public void actionPerformed(java.awt.event.ActionEvent evt) {
288 orgButtonActionPerformed(evt);
292 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(getContentPane());
293 getContentPane().setLayout(layout);
294 layout.setHorizontalGroup(
295 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
296 .addGroup(layout.createSequentialGroup()
298 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
299 .addGroup(layout.createSequentialGroup()
300 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
301 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
303 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
304 .addComponent(orgComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
305 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
306 .addComponent(orgButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
307 .addGroup(layout.createSequentialGroup()
308 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
309 .addComponent(jLabel3)
310 .addComponent(jLabel4)
311 .addComponent(databasePathLabel))
312 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
313 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
314 .addGroup(layout.createSequentialGroup()
315 .addComponent(fileTypeRadioButton)
317 .addComponent(centralRepoRadioButton))
318 .addComponent(hashSetNameTextField)
319 .addComponent(databasePathTextField))))
320 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
321 .addComponent(saveAsButton))
322 .addGroup(layout.createSequentialGroup()
323 .addGap(0, 0, Short.MAX_VALUE)
324 .addComponent(okButton)
325 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
326 .addComponent(cancelButton)))
328 .addGroup(layout.createSequentialGroup()
329 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
330 .addGroup(layout.createSequentialGroup()
332 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
333 .addComponent(knownRadioButton)
334 .addComponent(knownBadRadioButton)))
335 .addGroup(layout.createSequentialGroup()
337 .addComponent(jLabel2))
338 .addGroup(layout.createSequentialGroup()
340 .addComponent(sendIngestMessagesCheckbox)))
341 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
344 layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {cancelButton, okButton});
346 layout.setVerticalGroup(
347 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
348 .addGroup(layout.createSequentialGroup()
350 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
351 .addComponent(jLabel4)
352 .addComponent(fileTypeRadioButton)
353 .addComponent(centralRepoRadioButton))
354 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
355 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
356 .addComponent(jLabel3)
357 .addComponent(hashSetNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
358 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
359 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
360 .addComponent(databasePathLabel)
361 .addComponent(databasePathTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
362 .addComponent(saveAsButton))
363 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
364 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
366 .addComponent(orgComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
367 .addComponent(orgButton))
368 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
369 .addComponent(jLabel2)
370 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
371 .addComponent(knownRadioButton)
372 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
373 .addComponent(knownBadRadioButton)
374 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
375 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
376 .addGroup(layout.createSequentialGroup()
377 .addComponent(sendIngestMessagesCheckbox)
378 .addGap(0, 0, Short.MAX_VALUE))
379 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
380 .addGap(0, 0, Short.MAX_VALUE)
381 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
382 .addComponent(cancelButton)
383 .addComponent(okButton))))
390 private void knownRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {
391 sendIngestMessagesCheckbox.setSelected(
false);
392 sendIngestMessagesCheckbox.setEnabled(
false);
395 private void knownBadRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {
396 sendIngestMessagesCheckbox.setSelected(
true);
397 sendIngestMessagesCheckbox.setEnabled(
true);
400 private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {
404 private void saveAsButtonActionPerformed(java.awt.event.ActionEvent evt) {
406 String lastBaseDirectory = Paths.get(PlatformUtil.getUserConfigDirectory(),
"HashDatabases").toString();
407 if (ModuleSettings.settingExists(ModuleSettings.MAIN_SETTINGS, LAST_FILE_PATH_KEY)) {
408 lastBaseDirectory = ModuleSettings.getConfigSetting(ModuleSettings.MAIN_SETTINGS, LAST_FILE_PATH_KEY);
410 StringBuilder path =
new StringBuilder();
411 path.append(lastBaseDirectory);
412 File hashDbFolder =
new File(path.toString());
414 if (!hashDbFolder.exists()){
415 hashDbFolder.mkdir();
417 if (!hashSetNameTextField.getText().isEmpty()) {
418 path.append(File.separator).append(hashSetNameTextField.getText());
420 path.append(File.separator).append(DEFAULT_FILE_NAME);
422 path.append(
".").append(HashDbManager.getHashDatabaseFileExtension());
423 fileChooser.setSelectedFile(
new File(path.toString()));
424 if (fileChooser.showSaveDialog(
this) == JFileChooser.APPROVE_OPTION) {
425 File databaseFile = fileChooser.getSelectedFile();
426 databasePathTextField.setText(databaseFile.getCanonicalPath());
427 ModuleSettings.setConfigSetting(ModuleSettings.MAIN_SETTINGS, LAST_FILE_PATH_KEY, databaseFile.getParent());
429 }
catch (IOException ex) {
430 Logger.getLogger(HashDbCreateDatabaseDialog.class.getName()).log(Level.WARNING,
"Couldn't get selected file path.", ex);
434 @NbBundle.Messages({
"HashDbCreateDatabaseDialog.missingOrg=An organization must be selected",
435 "HashDbCreateDatabaseDialog.duplicateName=A hashset with this name already exists",
436 "HashDbCreateDatabaseDialog.databaseLookupError=Error accessing central repository",
437 "HashDbCreateDatabaseDialog.databaseCreationError=Error creating new hash set"
439 private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {
443 if (hashSetNameTextField.getText().isEmpty()) {
444 JOptionPane.showMessageDialog(
this,
445 NbBundle.getMessage(
this.getClass(),
446 "HashDbCreateDatabaseDialog.mustEnterHashSetNameMsg"),
447 NbBundle.getMessage(
this.getClass(),
448 "HashDbCreateDatabaseDialog.createHashDbErr"),
449 JOptionPane.ERROR_MESSAGE);
453 if(fileTypeRadioButton.isSelected()){
454 if (databasePathTextField.getText().isEmpty()) {
455 JOptionPane.showMessageDialog(
this,
456 NbBundle.getMessage(
this.getClass(),
457 "HashDbCreateDatabaseDialog.mustEnterHashDbPathMsg"),
458 NbBundle.getMessage(
this.getClass(),
459 "HashDbCreateDatabaseDialog.createHashDbErr"),
460 JOptionPane.ERROR_MESSAGE);
464 if(selectedOrg == null){
465 JOptionPane.showMessageDialog(
this,
466 NbBundle.getMessage(
this.getClass(),
467 "HashDbCreateDatabaseDialog.missingOrg"),
468 NbBundle.getMessage(
this.getClass(),
469 "HashDbCreateDatabaseDialog.createHashDbErr"),
470 JOptionPane.ERROR_MESSAGE);
476 TskData.FileKnown fileKnown;
477 if (knownRadioButton.isSelected()) {
478 type = KnownFilesType.KNOWN;
479 fileKnown = TskData.FileKnown.KNOWN;
481 type = KnownFilesType.KNOWN_BAD;
482 fileKnown = TskData.FileKnown.BAD;
485 String errorMessage = NbBundle
486 .getMessage(this.getClass(),
"HashDbCreateDatabaseDialog.errMsg.hashDbCreationErr");
488 if(fileTypeRadioButton.isSelected()){
490 newHashDb = HashDbManager.getInstance().addNewHashDatabaseNoSave(hashSetNameTextField.getText(), fileChooser.getSelectedFile().getCanonicalPath(),
true, sendIngestMessagesCheckbox.isSelected(), type);
491 }
catch (IOException ex) {
492 Logger.getLogger(HashDbCreateDatabaseDialog.class.getName()).log(Level.WARNING, errorMessage, ex);
493 JOptionPane.showMessageDialog(
this,
494 NbBundle.getMessage(
this.getClass(),
495 "HashDbCreateDatabaseDialog.cannotCreateFileAtLocMsg"),
496 NbBundle.getMessage(
this.getClass(),
497 "HashDbCreateDatabaseDialog.createHashDbErr"),
498 JOptionPane.ERROR_MESSAGE);
500 }
catch (HashDbManagerException ex) {
501 Logger.getLogger(HashDbCreateDatabaseDialog.class.getName()).log(Level.WARNING, errorMessage, ex);
502 JOptionPane.showMessageDialog(
this,
504 NbBundle.getMessage(this.getClass(),
505 "HashDbCreateDatabaseDialog.createHashDbErr"),
506 JOptionPane.ERROR_MESSAGE);
512 if(EamDb.getInstance().referenceSetExists(hashSetNameTextField.getText(),
"")){
513 JOptionPane.showMessageDialog(
this,
514 NbBundle.getMessage(
this.getClass(),
515 "HashDbCreateDatabaseDialog.duplicateName"),
516 NbBundle.getMessage(
this.getClass(),
517 "HashDbCreateDatabaseDialog.createHashDbErr"),
518 JOptionPane.ERROR_MESSAGE);
521 }
catch (EamDbException ex){
522 Logger.getLogger(HashDbImportDatabaseDialog.class.getName()).log(Level.SEVERE,
"Error looking up reference set", ex);
523 JOptionPane.showMessageDialog(
this,
524 NbBundle.getMessage(
this.getClass(),
525 "HashDbCreateDatabaseDialog.databaseLookupError"),
526 NbBundle.getMessage(
this.getClass(),
527 "HashDbCreateDatabaseDialog.createHashDbErr"),
528 JOptionPane.ERROR_MESSAGE);
533 int referenceSetID = EamDb.getInstance().newReferenceSet(
new EamGlobalSet(selectedOrg.getOrgID(), hashSetNameTextField.getText(),
534 "", fileKnown,
false, EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID)));
535 newHashDb = HashDbManager.getInstance().addExistingCentralRepoHashSet(hashSetNameTextField.getText(),
537 true, sendIngestMessagesCheckbox.isSelected(), type,
false);
538 }
catch (EamDbException | TskCoreException ex){
539 Logger.getLogger(HashDbImportDatabaseDialog.class.getName()).log(Level.SEVERE,
"Error creating new reference set", ex);
540 JOptionPane.showMessageDialog(
this,
541 NbBundle.getMessage(
this.getClass(),
542 "HashDbCreateDatabaseDialog.databaseCreationError"),
543 NbBundle.getMessage(
this.getClass(),
544 "HashDbCreateDatabaseDialog.createHashDbErr"),
545 JOptionPane.ERROR_MESSAGE);
553 private void sendIngestMessagesCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
557 private void orgButtonActionPerformed(java.awt.event.ActionEvent evt) {
558 ManageOrganizationsDialog dialog =
new ManageOrganizationsDialog();
560 if (dialog.isChanged()) {
565 private void orgComboBoxActionPerformed(java.awt.event.ActionEvent evt) {
566 if (null == orgComboBox.getSelectedItem())
return;
567 String orgName = this.orgComboBox.getSelectedItem().toString();
568 for (EamOrganization
org : orgs) {
569 if (
org.getName().equals(orgName)) {
576 private void fileTypeRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {
580 private void centralRepoRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {
585 private javax.swing.ButtonGroup buttonGroup1;
586 private javax.swing.JButton cancelButton;
587 private javax.swing.JRadioButton centralRepoRadioButton;
588 private javax.swing.JLabel databasePathLabel;
589 private javax.swing.JTextField databasePathTextField;
590 private javax.swing.JRadioButton fileTypeRadioButton;
591 private javax.swing.JTextField hashSetNameTextField;
592 private javax.swing.JLabel jLabel2;
593 private javax.swing.JLabel jLabel3;
594 private javax.swing.JLabel jLabel4;
595 private javax.swing.JRadioButton knownBadRadioButton;
596 private javax.swing.JRadioButton knownRadioButton;
597 private javax.swing.JLabel lbOrg;
598 private javax.swing.JButton okButton;
599 private javax.swing.JButton orgButton;
600 private javax.swing.JComboBox<String> orgComboBox;
601 private javax.swing.JButton saveAsButton;
602 private javax.swing.JCheckBox sendIngestMessagesCheckbox;
603 private javax.swing.ButtonGroup storageTypeButtonGroup;