19 package org.sleuthkit.autopsy.modules.interestingitems;
21 import java.awt.EventQueue;
23 import java.util.ArrayList;
24 import java.util.Collection;
25 import java.util.Collections;
26 import java.util.Comparator;
27 import java.util.HashMap;
28 import java.util.List;
30 import java.util.SortedSet;
31 import java.util.TreeMap;
32 import java.util.logging.Level;
33 import java.util.stream.Collectors;
34 import javax.swing.DefaultListModel;
35 import javax.swing.JButton;
36 import javax.swing.JFileChooser;
37 import javax.swing.JOptionPane;
38 import javax.swing.event.ListSelectionEvent;
39 import javax.swing.event.ListSelectionListener;
40 import javax.swing.filechooser.FileNameExtensionFilter;
41 import org.apache.commons.lang3.tuple.Pair;
42 import org.netbeans.spi.options.OptionsPanelController;
43 import org.openide.util.NbBundle;
44 import org.openide.util.NbBundle.Messages;
45 import org.openide.windows.WindowManager;
58 @SuppressWarnings(
"PMD.SingularField")
61 private static final long serialVersionUID = 1L;
63 @NbBundle.Messages({
"# {0} - filter name",
64 "# {1} - profile name",
65 "FilesSetDefsPanel.ingest.fileFilterInUseError=The selected file filter, {0}, is being used by a profile, {1}, and cannot be deleted while any profile uses it.",
66 "FilesSetDefsPanel.bytes=Bytes",
67 "FilesSetDefsPanel.kiloBytes=Kilobytes",
68 "FilesSetDefsPanel.megaBytes=Megabytes",
69 "FilesSetDefsPanel.gigaBytes=Gigabytes",
70 "FilesSetDefsPanel.loadError=Error loading interesting files sets from file.",
71 "FilesSetDefsPanel.saveError=Error saving interesting files sets to file.",
72 "FilesSetDefsPanel.interesting.copySetButton.text=Copy Set",
73 "FilesSetDefsPanel.interesting.importSetButton.text=Import Set",
74 "FilesSetDefsPanel.interesting.exportSetButton.text=Export Set"
81 private final DefaultListModel<FilesSet> setsListModel =
new DefaultListModel<>();
82 private final DefaultListModel<
FilesSet.
Rule> rulesListModel =
new DefaultListModel<>();
84 private final JButton okButton =
new JButton(
"OK");
85 private final JButton cancelButton =
new JButton(
"Cancel");
89 private boolean canBeEnabled =
true;
104 this.panelType = panelType;
105 this.initComponents();
108 this.setsList.setModel(setsListModel);
110 this.rulesList.setModel(rulesListModel);
112 this.ingestWarningLabel.setVisible(
false);
114 this.copySetButton.setVisible(
false);
115 this.importSetButton.setVisible(
false);
116 this.exportSetButton.setVisible(
false);
117 this.mimeTypeComboBox.setVisible(
false);
118 this.mimeTypeLabel.setVisible(
false);
119 this.fileSizeUnitComboBox.setVisible(
false);
120 this.fileSizeSpinner.setVisible(
false);
121 this.filterDialogTitle =
"FilesSetPanel.filter.title";
122 this.ruleDialogTitle =
"FilesSetPanel.rule.title";
123 this.fileSizeLabel.setVisible(
false);
124 this.equalitySignComboBox.setVisible(
false);
125 this.ignoreKnownFilesCheckbox.setVisible(
false);
126 this.fileTypeLabel.setVisible(
false);
127 this.filesRadioButton.setVisible(
false);
128 this.dirsRadioButton.setVisible(
false);
129 this.allRadioButton.setVisible(
false);
130 this.descriptionTextArea.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.jTextArea1.text"));
131 org.openide.awt.Mnemonics.setLocalizedText(setsListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.setsListLabel.text"));
132 org.openide.awt.Mnemonics.setLocalizedText(editSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.editSetButton.text"));
133 org.openide.awt.Mnemonics.setLocalizedText(newSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.newSetButton.text"));
134 org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.deleteSetButton.text"));
135 org.openide.awt.Mnemonics.setLocalizedText(setDetailsLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.jLabel6.text"));
137 this.filterDialogTitle =
"FilesSetPanel.interesting.title";
138 this.ruleDialogTitle =
"FilesSetPanel.interesting.title";
139 this.ingoreUnallocCheckbox.setVisible(
false);
150 @NbBundle.Messages({
"FilesSetDefsPanel.Interesting.Title=Global Interesting Items Settings",
151 "FilesSetDefsPanel.Ingest.Title=File Filter Settings"})
154 setName(Bundle.FilesSetDefsPanel_Ingest_Title());
156 setName(Bundle.FilesSetDefsPanel_Interesting_Title());
161 detectableMimeTypes.forEach((type) -> {
162 mimeTypeComboBox.addItem(type);
165 logger.log(Level.SEVERE,
"Unable to get detectable file types", ex);
168 this.fileSizeUnitComboBox.setSelectedIndex(1);
169 this.equalitySignComboBox.setSelectedIndex(2);
183 logger.log(Level.WARNING, Bundle.FilesSetDefsPanel_saveError(), ex);
188 FilesSet selectedFilesSet = this.setsList.getSelectedValue();
189 boolean setSelected = (selectedFilesSet != null);
190 boolean isStandardSet = (selectedFilesSet != null && selectedFilesSet.isStandardSet());
194 newRuleButton.setEnabled(canBeEnabled && !isStandardSet);
195 copySetButton.setEnabled(canBeEnabled && setSelected);
196 newSetButton.setEnabled(canBeEnabled);
197 editRuleButton.setEnabled(canBeEnabled && ruleSelected && !isStandardSet);
198 editSetButton.setEnabled(canBeEnabled && setSelected && !isStandardSet);
199 exportSetButton.setEnabled(setSelected);
200 importSetButton.setEnabled(canBeEnabled);
201 deleteRuleButton.setEnabled(canBeEnabled && ruleSelected && !isStandardSet);
202 deleteSetButton.setEnabled(canBeEnabled && setSelected && !isStandardSet);
203 ingestWarningLabel.setVisible(!canBeEnabled);
213 this.resetComponents();
226 logger.log(Level.WARNING, Bundle.FilesSetDefsPanel_loadError(), ex);
227 this.filesSets =
new TreeMap<>();
232 this.filesSets.values().forEach((set) -> {
233 this.setsListModel.addElement(set);
236 if (!this.filesSets.isEmpty()) {
239 EventQueue.invokeLater(() -> {
249 this.setsListModel.clear();
250 this.setDescriptionTextArea.setText(
"");
251 this.ignoreKnownFilesCheckbox.setSelected(
true);
252 this.ingoreUnallocCheckbox.setSelected(
true);
253 this.resetRuleComponents();
261 this.fileNameTextField.setText(
"");
262 this.fileNameRadioButton.setSelected(
true);
263 this.fileNameRegexCheckbox.setSelected(
false);
264 this.filesRadioButton.setSelected(
true);
265 this.rulePathConditionTextField.setText(
"");
266 this.daysIncludedTextField.setText(
"");
267 this.rulePathConditionRegexCheckBox.setSelected(
false);
268 this.mimeTypeComboBox.setSelectedIndex(0);
269 this.equalitySignComboBox.setSelectedIndex(2);
270 this.fileSizeUnitComboBox.setSelectedIndex(1);
271 this.fileSizeSpinner.setValue(0);
282 if (e.getValueIsAdjusting()) {
293 if (selectedSet != null) {
301 Collections.sort(rules,
new Comparator<FilesSet.Rule>() {
304 return rule1.toString().compareTo(rule2.toString());
307 rules.forEach((rule) -> {
326 if (e.getValueIsAdjusting()) {
342 if (nameCondition != null) {
353 switch (typeCondition.getMetaType()) {
360 case FILES_AND_DIRECTORIES:
364 if (pathCondition != null) {
371 if (mimeTypeCondition != null) {
376 if (fileSizeCondition != null) {
385 if (dateCondition != null) {
392 resetRuleComponents();
412 if (selectedSet != null) {
423 int option = JOptionPane.OK_OPTION;
425 option = JOptionPane.showConfirmDialog(
this, panel, NbBundle.getMessage(
FilesSetPanel.class, filterDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
426 }
while (option == JOptionPane.OK_OPTION && !panel.isValidDefinition());
428 if (option == JOptionPane.OK_OPTION) {
430 if (selectedSet != null) {
434 rules.putAll(selectedSet.
getRules());
438 panel.getFilesSetName(),
439 panel.getFilesSetDescription(),
440 panel.getFileSetIgnoresKnownFiles(),
441 panel.getFileSetIgnoresUnallocatedSpace(),
445 Pair<FilesSet, Integer> result = handleConflict(filesSet,
false);
446 option = result.getRight();
447 FilesSet toAddOrUpdate = result.getLeft();
449 if (result.getRight() == JOptionPane.OK_OPTION) {
450 if (shouldCreateNew) {
451 this.replaceFilesSet(null, toAddOrUpdate, null);
453 this.replaceFilesSet(selectedSet, toAddOrUpdate, null);
468 FilesSetRulePanel panel;
469 if (selectedRule != null) {
471 panel =
new FilesSetRulePanel(selectedRule, okButton, cancelButton, panelType);
474 panel =
new FilesSetRulePanel(okButton, cancelButton, panelType);
479 int option = JOptionPane.OK_OPTION;
481 option = JOptionPane.showOptionDialog(
this, panel, NbBundle.getMessage(
FilesSetPanel.class, ruleDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null,
new Object[]{okButton, cancelButton}, okButton);
483 }
while (option == JOptionPane.OK_OPTION && !panel.isValidRuleDefinition());
485 if (option == JOptionPane.OK_OPTION) {
489 FilesSet selectedSet = this.setsList.getSelectedValue();
494 if (selectedRule != null) {
495 rules.remove(selectedRule.getUuid());
497 FilesSet.
Rule newRule =
new FilesSet.
Rule(panel.getRuleName(), panel.getFileNameCondition(), panel.getMetaTypeCondition(), panel.getPathCondition(), panel.getMimeTypeCondition(), panel.getFileSizeCondition(), panel.getDateCondition());
498 rules.put(newRule.getUuid(), newRule);
502 this.replaceFilesSet(selectedSet, selectedSet, rules);
507 EventQueue.invokeLater(() -> {
508 this.rulesList.setSelectedValue(newRule,
true);
525 if (oldSet != null) {
528 this.filesSets.remove(oldSet.
getName());
542 newSet.isStandardSet(),
543 newSet.getVersionNumber()
547 this.filesSets.put(setToAdd.
getName(), setToAdd);
552 this.filesSets.values().forEach((set) -> {
553 this.setsListModel.addElement(set);
559 this.setsList.setSelectedValue(setToAdd,
true);
567 @SuppressWarnings(
"unchecked")
569 private
void initComponents() {
571 fileNameButtonGroup =
new javax.swing.ButtonGroup();
572 typeButtonGroup =
new javax.swing.ButtonGroup();
573 jScrollPane1 =
new javax.swing.JScrollPane();
574 jPanel1 =
new javax.swing.JPanel();
575 setDetailsLabel =
new javax.swing.JLabel();
576 newRuleButton =
new javax.swing.JButton();
577 filesRadioButton =
new javax.swing.JRadioButton();
578 editRuleButton =
new javax.swing.JButton();
579 rulesListLabel =
new javax.swing.JLabel();
580 rulesListScrollPane =
new javax.swing.JScrollPane();
581 rulesList =
new javax.swing.JList<>();
582 setDescScrollPanel =
new javax.swing.JScrollPane();
583 setDescriptionTextArea =
new javax.swing.JTextArea();
584 editSetButton =
new javax.swing.JButton();
585 setsListScrollPane =
new javax.swing.JScrollPane();
586 setsList =
new javax.swing.JList<>();
587 fileNameExtensionRadioButton =
new javax.swing.JRadioButton();
588 nameLabel =
new javax.swing.JLabel();
589 fileNameTextField =
new javax.swing.JTextField();
590 descriptionLabel =
new javax.swing.JLabel();
591 fileNameRadioButton =
new javax.swing.JRadioButton();
592 rulePathConditionTextField =
new javax.swing.JTextField();
593 ignoreKnownFilesCheckbox =
new javax.swing.JCheckBox();
594 fileNameRegexCheckbox =
new javax.swing.JCheckBox();
595 separator =
new javax.swing.JSeparator();
596 setsListLabel =
new javax.swing.JLabel();
597 allRadioButton =
new javax.swing.JRadioButton();
598 deleteSetButton =
new javax.swing.JButton();
599 deleteRuleButton =
new javax.swing.JButton();
600 newSetButton =
new javax.swing.JButton();
601 fileTypeLabel =
new javax.swing.JLabel();
602 dirsRadioButton =
new javax.swing.JRadioButton();
603 ruleLabel =
new javax.swing.JLabel();
604 pathLabel =
new javax.swing.JLabel();
605 rulePathConditionRegexCheckBox =
new javax.swing.JCheckBox();
606 descriptionScrollPane =
new javax.swing.JScrollPane();
607 descriptionTextArea =
new javax.swing.JTextArea();
608 mimeTypeLabel =
new javax.swing.JLabel();
609 mimeTypeComboBox =
new javax.swing.JComboBox<>();
610 fileSizeLabel =
new javax.swing.JLabel();
611 equalitySignComboBox =
new javax.swing.JComboBox<String>();
612 fileSizeSpinner =
new javax.swing.JSpinner();
613 fileSizeUnitComboBox =
new javax.swing.JComboBox<String>();
614 ingoreUnallocCheckbox =
new javax.swing.JCheckBox();
615 ingestWarningLabel =
new javax.swing.JLabel();
616 copySetButton =
new javax.swing.JButton();
617 importSetButton =
new javax.swing.JButton();
618 exportSetButton =
new javax.swing.JButton();
619 modifiedDateLabel =
new javax.swing.JLabel();
620 daysIncludedTextField =
new javax.swing.JTextField();
621 daysIncludedLabel =
new javax.swing.JLabel();
623 org.openide.awt.Mnemonics.setLocalizedText(setDetailsLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.jLabel6.text"));
625 newRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
626 org.openide.awt.Mnemonics.setLocalizedText(newRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.newRuleButton.text"));
627 newRuleButton.addActionListener(
new java.awt.event.ActionListener() {
628 public void actionPerformed(java.awt.event.ActionEvent evt) {
629 newRuleButtonActionPerformed(evt);
633 typeButtonGroup.add(filesRadioButton);
634 filesRadioButton.setSelected(
true);
635 org.openide.awt.Mnemonics.setLocalizedText(filesRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.filesRadioButton.text"));
636 filesRadioButton.setEnabled(
false);
638 editRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/edit16.png")));
639 org.openide.awt.Mnemonics.setLocalizedText(editRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.editRuleButton.text"));
640 editRuleButton.setEnabled(
false);
641 editRuleButton.addActionListener(
new java.awt.event.ActionListener() {
642 public void actionPerformed(java.awt.event.ActionEvent evt) {
643 editRuleButtonActionPerformed(evt);
647 org.openide.awt.Mnemonics.setLocalizedText(rulesListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulesListLabel.text"));
649 rulesList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
650 rulesListScrollPane.setViewportView(rulesList);
652 setDescScrollPanel.setMinimumSize(
new java.awt.Dimension(10, 22));
653 setDescScrollPanel.setPreferredSize(
new java.awt.Dimension(14, 40));
655 setDescriptionTextArea.setEditable(
false);
656 setDescriptionTextArea.setBackground(
new java.awt.Color(240, 240, 240));
657 setDescriptionTextArea.setColumns(20);
658 setDescriptionTextArea.setLineWrap(
true);
659 setDescriptionTextArea.setRows(6);
660 setDescriptionTextArea.setMinimumSize(
new java.awt.Dimension(10, 22));
661 setDescriptionTextArea.setOpaque(
false);
662 setDescScrollPanel.setViewportView(setDescriptionTextArea);
664 editSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/edit16.png")));
665 org.openide.awt.Mnemonics.setLocalizedText(editSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.editSetButton.text"));
666 editSetButton.setEnabled(
false);
667 editSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
668 editSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
669 editSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
670 editSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
671 editSetButton.addActionListener(
new java.awt.event.ActionListener() {
672 public void actionPerformed(java.awt.event.ActionEvent evt) {
673 editSetButtonActionPerformed(evt);
677 setsList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
678 setsListScrollPane.setViewportView(setsList);
680 fileNameButtonGroup.add(fileNameExtensionRadioButton);
681 org.openide.awt.Mnemonics.setLocalizedText(fileNameExtensionRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameExtensionRadioButton.text"));
682 fileNameExtensionRadioButton.setEnabled(
false);
684 org.openide.awt.Mnemonics.setLocalizedText(nameLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.nameLabel.text"));
686 fileNameTextField.setEditable(
false);
687 fileNameTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameTextField.text"));
689 org.openide.awt.Mnemonics.setLocalizedText(descriptionLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.descriptionLabel.text"));
691 fileNameButtonGroup.add(fileNameRadioButton);
692 org.openide.awt.Mnemonics.setLocalizedText(fileNameRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameRadioButton.text"));
693 fileNameRadioButton.setEnabled(
false);
695 rulePathConditionTextField.setEditable(
false);
696 rulePathConditionTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulePathConditionTextField.text"));
698 org.openide.awt.Mnemonics.setLocalizedText(ignoreKnownFilesCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ignoreKnownFilesCheckbox.text"));
699 ignoreKnownFilesCheckbox.setEnabled(
false);
701 org.openide.awt.Mnemonics.setLocalizedText(fileNameRegexCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameRegexCheckbox.text"));
702 fileNameRegexCheckbox.setEnabled(
false);
703 fileNameRegexCheckbox.addActionListener(
new java.awt.event.ActionListener() {
704 public void actionPerformed(java.awt.event.ActionEvent evt) {
705 fileNameRegexCheckboxActionPerformed(evt);
709 separator.setOrientation(javax.swing.SwingConstants.VERTICAL);
711 org.openide.awt.Mnemonics.setLocalizedText(setsListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.setsListLabel.text"));
713 typeButtonGroup.add(allRadioButton);
714 org.openide.awt.Mnemonics.setLocalizedText(allRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.allRadioButton.text"));
715 allRadioButton.setEnabled(
false);
717 deleteSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
718 org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.deleteSetButton.text"));
719 deleteSetButton.setEnabled(
false);
720 deleteSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
721 deleteSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
722 deleteSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
723 deleteSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
724 deleteSetButton.addActionListener(
new java.awt.event.ActionListener() {
725 public void actionPerformed(java.awt.event.ActionEvent evt) {
726 deleteSetButtonActionPerformed(evt);
730 deleteRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
731 org.openide.awt.Mnemonics.setLocalizedText(deleteRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.deleteRuleButton.text"));
732 deleteRuleButton.setEnabled(
false);
733 deleteRuleButton.addActionListener(
new java.awt.event.ActionListener() {
734 public void actionPerformed(java.awt.event.ActionEvent evt) {
735 deleteRuleButtonActionPerformed(evt);
739 newSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
740 org.openide.awt.Mnemonics.setLocalizedText(newSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.newSetButton.text"));
741 newSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
742 newSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
743 newSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
744 newSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
745 newSetButton.addActionListener(
new java.awt.event.ActionListener() {
746 public void actionPerformed(java.awt.event.ActionEvent evt) {
747 newSetButtonActionPerformed(evt);
751 org.openide.awt.Mnemonics.setLocalizedText(fileTypeLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileTypeLabel.text"));
753 typeButtonGroup.add(dirsRadioButton);
754 org.openide.awt.Mnemonics.setLocalizedText(dirsRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.dirsRadioButton.text"));
755 dirsRadioButton.setEnabled(
false);
757 org.openide.awt.Mnemonics.setLocalizedText(ruleLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ruleLabel.text"));
759 org.openide.awt.Mnemonics.setLocalizedText(pathLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.pathLabel.text"));
761 org.openide.awt.Mnemonics.setLocalizedText(rulePathConditionRegexCheckBox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulePathConditionRegexCheckBox.text"));
762 rulePathConditionRegexCheckBox.setEnabled(
false);
764 descriptionTextArea.setEditable(
false);
765 descriptionTextArea.setBackground(
new java.awt.Color(240, 240, 240));
766 descriptionTextArea.setColumns(20);
767 descriptionTextArea.setLineWrap(
true);
768 descriptionTextArea.setRows(3);
769 descriptionTextArea.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.jTextArea1.text"));
770 descriptionTextArea.setWrapStyleWord(
true);
771 descriptionTextArea.setOpaque(
false);
772 descriptionScrollPane.setViewportView(descriptionTextArea);
774 org.openide.awt.Mnemonics.setLocalizedText(mimeTypeLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.mimeTypeLabel.text"));
776 mimeTypeComboBox.setBackground(
new java.awt.Color(240, 240, 240));
777 mimeTypeComboBox.setEditable(
true);
778 mimeTypeComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] {
""}));
779 mimeTypeComboBox.setEnabled(
false);
780 mimeTypeComboBox.setMinimumSize(
new java.awt.Dimension(0, 20));
781 mimeTypeComboBox.setPreferredSize(
new java.awt.Dimension(12, 20));
783 org.openide.awt.Mnemonics.setLocalizedText(fileSizeLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileSizeLabel.text"));
785 equalitySignComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] {
"=",
">",
"≥",
"<",
"≤" }));
786 equalitySignComboBox.setEnabled(
false);
788 fileSizeSpinner.setEnabled(
false);
789 fileSizeSpinner.setMinimumSize(
new java.awt.Dimension(2, 20));
791 fileSizeUnitComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] { Bundle.FilesSetDefsPanel_bytes(), Bundle.FilesSetDefsPanel_kiloBytes(), Bundle.FilesSetDefsPanel_megaBytes(), Bundle.FilesSetDefsPanel_gigaBytes() }));
792 fileSizeUnitComboBox.setEnabled(
false);
794 org.openide.awt.Mnemonics.setLocalizedText(ingoreUnallocCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingoreUnallocCheckbox.text"));
795 ingoreUnallocCheckbox.setToolTipText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingoreUnallocCheckbox.toolTipText"));
796 ingoreUnallocCheckbox.setEnabled(
false);
798 ingestWarningLabel.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png")));
799 org.openide.awt.Mnemonics.setLocalizedText(ingestWarningLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingestWarningLabel.text"));
801 copySetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/new16.png")));
802 org.openide.awt.Mnemonics.setLocalizedText(copySetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.copySetButton.text"));
803 copySetButton.setEnabled(
false);
804 copySetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
805 copySetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
806 copySetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
807 copySetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
808 copySetButton.addActionListener(
new java.awt.event.ActionListener() {
809 public void actionPerformed(java.awt.event.ActionEvent evt) {
810 copySetButtonActionPerformed(evt);
814 importSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/import16.png")));
815 org.openide.awt.Mnemonics.setLocalizedText(importSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.importSetButton.text"));
816 importSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
817 importSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
818 importSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
819 importSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
820 importSetButton.addActionListener(
new java.awt.event.ActionListener() {
821 public void actionPerformed(java.awt.event.ActionEvent evt) {
822 importSetButtonActionPerformed(evt);
826 exportSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/export16.png")));
827 org.openide.awt.Mnemonics.setLocalizedText(exportSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.exportSetButton.text"));
828 exportSetButton.setEnabled(
false);
829 exportSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
830 exportSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
831 exportSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
832 exportSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
833 exportSetButton.addActionListener(
new java.awt.event.ActionListener() {
834 public void actionPerformed(java.awt.event.ActionEvent evt) {
835 exportSetButtonActionPerformed(evt);
839 org.openide.awt.Mnemonics.setLocalizedText(modifiedDateLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.modifiedDateLabel.text"));
841 daysIncludedTextField.setEditable(
false);
842 daysIncludedTextField.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
843 daysIncludedTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.daysIncludedTextField.text"));
844 daysIncludedTextField.setMinimumSize(
new java.awt.Dimension(60, 20));
845 daysIncludedTextField.setPreferredSize(
new java.awt.Dimension(60, 20));
847 org.openide.awt.Mnemonics.setLocalizedText(daysIncludedLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.daysIncludedLabel.text"));
848 daysIncludedLabel.setEnabled(
false);
850 javax.swing.GroupLayout jPanel1Layout =
new javax.swing.GroupLayout(jPanel1);
851 jPanel1.setLayout(jPanel1Layout);
852 jPanel1Layout.setHorizontalGroup(
853 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
854 .addGroup(jPanel1Layout.createSequentialGroup()
856 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
857 .addGroup(jPanel1Layout.createSequentialGroup()
858 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
false)
859 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
860 .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
861 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
862 .addComponent(importSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
863 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
864 .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
865 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
866 .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
867 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
868 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
869 .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
870 .addComponent(deleteSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
871 .addComponent(setsListScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
872 .addComponent(descriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
873 .addComponent(setsListLabel))
874 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
875 .addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
876 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
877 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
878 .addGroup(jPanel1Layout.createSequentialGroup()
879 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
880 .addComponent(rulesListScrollPane, javax.swing.GroupLayout.Alignment.TRAILING)
881 .addComponent(setDescScrollPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
882 .addGroup(jPanel1Layout.createSequentialGroup()
884 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
885 .addComponent(mimeTypeLabel)
886 .addComponent(fileSizeLabel)
887 .addComponent(fileTypeLabel)
888 .addComponent(pathLabel)
889 .addComponent(modifiedDateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
890 .addComponent(nameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
891 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
892 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
893 .addComponent(rulePathConditionTextField)
894 .addComponent(fileNameTextField, javax.swing.GroupLayout.Alignment.TRAILING)
895 .addComponent(mimeTypeComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
896 .addGroup(jPanel1Layout.createSequentialGroup()
897 .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
898 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
899 .addComponent(fileSizeSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
900 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
901 .addComponent(fileSizeUnitComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
902 .addGroup(jPanel1Layout.createSequentialGroup()
903 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
904 .addComponent(rulePathConditionRegexCheckBox)
905 .addGroup(jPanel1Layout.createSequentialGroup()
906 .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
907 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
908 .addComponent(daysIncludedLabel))
909 .addGroup(jPanel1Layout.createSequentialGroup()
910 .addComponent(filesRadioButton)
911 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
912 .addComponent(dirsRadioButton)
913 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
914 .addComponent(allRadioButton))
915 .addGroup(jPanel1Layout.createSequentialGroup()
916 .addComponent(fileNameRadioButton)
917 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
918 .addComponent(fileNameExtensionRadioButton)
919 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
920 .addComponent(fileNameRegexCheckbox)))
921 .addGap(0, 0, Short.MAX_VALUE)))))
923 .addGroup(jPanel1Layout.createSequentialGroup()
924 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
925 .addComponent(rulesListLabel)
926 .addGroup(jPanel1Layout.createSequentialGroup()
927 .addComponent(ignoreKnownFilesCheckbox)
928 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
929 .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
930 .addGroup(jPanel1Layout.createSequentialGroup()
931 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
932 .addComponent(descriptionLabel)
933 .addComponent(setDetailsLabel))
934 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
935 .addComponent(ingestWarningLabel))
936 .addComponent(ruleLabel)
937 .addGroup(jPanel1Layout.createSequentialGroup()
938 .addComponent(newRuleButton)
940 .addComponent(editRuleButton)
942 .addComponent(deleteRuleButton)))
943 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
946 jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {copySetButton, deleteSetButton, editSetButton, exportSetButton, importSetButton, newSetButton});
948 jPanel1Layout.setVerticalGroup(
949 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
950 .addGroup(jPanel1Layout.createSequentialGroup()
952 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
953 .addComponent(separator)
954 .addGroup(jPanel1Layout.createSequentialGroup()
955 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
956 .addGroup(jPanel1Layout.createSequentialGroup()
957 .addComponent(setDetailsLabel)
958 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
959 .addComponent(descriptionLabel)
961 .addComponent(ingestWarningLabel, javax.swing.GroupLayout.Alignment.TRAILING))
962 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
963 .addComponent(setDescScrollPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
964 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
965 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
966 .addComponent(ignoreKnownFilesCheckbox)
967 .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
968 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
969 .addComponent(rulesListLabel)
970 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
971 .addComponent(rulesListScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE)
972 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
973 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
974 .addComponent(newRuleButton)
975 .addComponent(editRuleButton)
976 .addComponent(deleteRuleButton))
977 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
978 .addComponent(ruleLabel)
979 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
980 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
981 .addComponent(fileTypeLabel)
982 .addComponent(filesRadioButton)
983 .addComponent(dirsRadioButton)
984 .addComponent(allRadioButton))
985 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
986 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
987 .addComponent(nameLabel)
988 .addComponent(fileNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
989 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
990 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
991 .addComponent(fileNameRadioButton)
992 .addComponent(fileNameExtensionRadioButton)
993 .addComponent(fileNameRegexCheckbox))
994 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
995 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
996 .addComponent(pathLabel)
997 .addComponent(rulePathConditionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
998 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
999 .addComponent(rulePathConditionRegexCheckBox)
1000 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1001 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1002 .addComponent(mimeTypeLabel)
1003 .addComponent(mimeTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1004 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1005 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1006 .addComponent(fileSizeLabel)
1007 .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1008 .addComponent(fileSizeSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1009 .addComponent(fileSizeUnitComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1010 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1011 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1012 .addComponent(modifiedDateLabel)
1013 .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1014 .addComponent(daysIncludedLabel))
1016 .addGroup(jPanel1Layout.createSequentialGroup()
1017 .addComponent(descriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1018 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1019 .addComponent(setsListLabel)
1020 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1021 .addComponent(setsListScrollPane)
1022 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1023 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1024 .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1025 .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1026 .addComponent(deleteSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1027 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1028 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1029 .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1030 .addComponent(importSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1031 .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1035 jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL,
new java.awt.Component[] {copySetButton, deleteRuleButton, deleteSetButton, editRuleButton, editSetButton, exportSetButton, importSetButton, newRuleButton, newSetButton});
1037 jScrollPane1.setViewportView(jPanel1);
1039 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
1040 this.setLayout(layout);
1041 layout.setHorizontalGroup(
1042 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1043 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE)
1045 layout.setVerticalGroup(
1046 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1047 .addComponent(jScrollPane1)
1052 this.doFileSetsDialog(null,
true);
1053 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1061 FilesSet oldSet = this.setsList.getSelectedValue();
1063 FilesSet.
Rule selectedRule = this.rulesList.getSelectedValue();
1064 rules.remove(selectedRule.getUuid());
1065 this.replaceFilesSet(oldSet, oldSet, rules);
1066 if (!this.rulesListModel.isEmpty()) {
1067 this.rulesList.setSelectedIndex(0);
1069 this.resetRuleComponents();
1071 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1075 FilesSet selectedSet = this.setsList.getSelectedValue();
1078 if (profile.getFileIngestFilter().equals(selectedSet.
getName())) {
1080 "FilesSetDefsPanel.ingest.fileFilterInUseError",
1081 selectedSet.
getName(), profile.toString()));
1087 this.filesSets.remove(selectedSet.
getName());
1088 this.setsListModel.removeElement(selectedSet);
1091 if (!this.filesSets.isEmpty()) {
1092 this.setsList.setSelectedIndex(0);
1094 this.resetComponents();
1096 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1100 this.doFileSetsDialog(this.setsList.getSelectedValue(),
false);
1101 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1105 this.doFilesSetRuleDialog(this.rulesList.getSelectedValue());
1106 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1110 this.doFilesSetRuleDialog(null);
1111 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1115 this.doFileSetsDialog(this.setsList.getSelectedValue(),
true);
1116 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1119 @NbBundle.Messages({
1120 "FilesSetDefsPanel.interesting.failImportMsg=Interesting files set not imported",
1121 "FilesSetDefsPanel.interesting.fileExtensionFilterLbl=Autopsy Interesting File Set File (xml)",
1122 "FilesSetDefsPanel.interesting.importButtonAction.featureName=Interesting Files Set Import"
1126 FilesSet selectedSet = this.setsList.getSelectedValue();
1127 JFileChooser chooser =
new JFileChooser();
1128 final String EXTENSION =
"xml";
1129 FileNameExtensionFilter autopsyFilter =
new FileNameExtensionFilter(
1130 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.fileExtensionFilterLbl"), EXTENSION);
1131 chooser.addChoosableFileFilter(autopsyFilter);
1132 chooser.setAcceptAllFileFilterUsed(
false);
1133 chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
1134 int returnVal = chooser.showOpenDialog(
this);
1135 if (returnVal == JFileChooser.APPROVE_OPTION) {
1136 File selFile = chooser.getSelectedFile();
1137 if (selFile == null) {
1138 JOptionPane.showMessageDialog(
this,
1139 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.failImportMsg"),
1140 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.importButtonAction.featureName"),
1141 JOptionPane.WARNING_MESSAGE);
1142 logger.warning(
"Selected file was null, when trying to import interesting files set definitions");
1145 Collection<FilesSet> importedSets;
1147 importedSets = InterestingItemsFilesSetSettings.readDefinitionsXML(selFile).values();
1148 if (importedSets.isEmpty()) {
1152 JOptionPane.showMessageDialog(
this,
1153 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.failImportMsg"),
1154 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.importButtonAction.featureName"),
1155 JOptionPane.WARNING_MESSAGE);
1156 logger.log(Level.WARNING,
"No Interesting files set definitions were read from the selected file, exception", ex);
1160 importedSets = importedSets
1163 .collect(Collectors.toList());
1165 FilesSet newSelected = determineFilesToImport(importedSets);
1169 this.filesSets.values().forEach((set) -> {
1170 this.setsListModel.addElement(set);
1175 this.setsList.setSelectedValue(newSelected == null ? selectedSet : newSelected,
true);
1177 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1193 for (
FilesSet set : importedSets) {
1194 Pair<FilesSet, Integer> conflictResult = handleConflict(set,
true);
1195 int choice = conflictResult.getRight();
1196 FilesSet resultingFilesSet = conflictResult.getLeft();
1198 if (choice == JOptionPane.OK_OPTION) {
1199 selectedSet = resultingFilesSet;
1200 this.filesSets.put(resultingFilesSet.
getName(), resultingFilesSet);
1201 }
else if (choice == JOptionPane.CANCEL_OPTION) {
1224 if (conflict == null) {
1225 return Pair.of(set, JOptionPane.OK_OPTION);
1229 if (conflict.isStandardSet()) {
1230 return onImportStandardSetConflict(set);
1232 return onImportConflict(set);
1235 if (conflict.isStandardSet()) {
1236 return onNewEditSetStandardSetConflict(set);
1238 return onNewEditSetConflict(set);
1255 "FilesSetDefsPanel.yesOwMsg=Yes, overwrite",
1256 "FilesSetDefsPanel.noSkipMsg=No, skip",
1257 "FilesSetDefsPanel.cancelImportMsg=Cancel import",
1258 "# {0} - FilesSet name",
1259 "FilesSetDefsPanel.interesting.overwriteSetPrompt=Interesting files set \"{0}\" already exists locally, overwrite?",
1260 "FilesSetDefsPanel.interesting.importOwConflict=Import Interesting files set conflict",})
1263 Object[] options = {
1264 Bundle.FilesSetDefsPanel_yesOwMsg(),
1265 Bundle.FilesSetDefsPanel_noSkipMsg(),
1266 Bundle.FilesSetDefsPanel_cancelImportMsg()
1268 int conflictChoice = JOptionPane.showOptionDialog(
this,
1269 Bundle.FilesSetDefsPanel_interesting_overwriteSetPrompt(set.
getName()),
1270 Bundle.FilesSetDefsPanel_interesting_importOwConflict(),
1271 JOptionPane.YES_NO_CANCEL_OPTION,
1272 JOptionPane.QUESTION_MESSAGE,
1277 if (conflictChoice == JOptionPane.OK_OPTION) {
1279 return Pair.of(set, conflictChoice);
1282 return Pair.of(null, conflictChoice);
1296 "FilesSetDefsPanel.yesStandardFileConflictCreate=Yes, create",
1297 "# {0} - FilesSet name",
1298 "# {1} - New FilesSet name",
1299 "FilesSetDefsPanel.interesting.standardFileConflict=A standard interesting file set already exists with the name \"{0}.\" Would you like to rename your set to \"{1}?\"",})
1303 Object[] options = {
1304 Bundle.FilesSetDefsPanel_yesStandardFileConflictCreate(),
1305 Bundle.FilesSetDefsPanel_noSkipMsg(),
1306 Bundle.FilesSetDefsPanel_cancelImportMsg()
1309 String setName = set.
getName();
1310 String customSetName = Bundle.StandardInterestingFileSetsLoader_customSuffixed(set.
getName());
1312 int conflictChoice = JOptionPane.showOptionDialog(
this,
1313 Bundle.FilesSetDefsPanel_interesting_standardFileConflict(setName, customSetName),
1314 Bundle.FilesSetDefsPanel_interesting_importOwConflict(),
1315 JOptionPane.YES_NO_CANCEL_OPTION,
1316 JOptionPane.QUESTION_MESSAGE,
1322 if (conflictChoice == JOptionPane.OK_OPTION) {
1326 return Pair.of(null, conflictChoice);
1340 "FilesSetDefsPanel.cancelNewSetMsg=Cancel",
1341 "FilesSetDefsPanel.interesting.newOwConflict=Interesting files set conflict",})
1344 Object[] options = {
1345 Bundle.FilesSetDefsPanel_yesOwMsg(),
1346 Bundle.FilesSetDefsPanel_cancelNewSetMsg()
1348 int conflictChoice = JOptionPane.showOptionDialog(
this,
1349 Bundle.FilesSetDefsPanel_interesting_overwriteSetPrompt(set.
getName()),
1350 Bundle.FilesSetDefsPanel_interesting_newOwConflict(),
1351 JOptionPane.OK_CANCEL_OPTION,
1352 JOptionPane.QUESTION_MESSAGE,
1357 if (conflictChoice == JOptionPane.OK_OPTION) {
1359 return Pair.of(set, conflictChoice);
1362 return Pair.of(null, conflictChoice);
1378 Object[] options = {
1379 Bundle.FilesSetDefsPanel_yesStandardFileConflictCreate(),
1380 Bundle.FilesSetDefsPanel_cancelNewSetMsg()
1383 String setName = set.
getName();
1384 String customSetName = Bundle.StandardInterestingFileSetsLoader_customSuffixed(set.
getName());
1386 int conflictChoice = JOptionPane.showOptionDialog(
this,
1387 Bundle.FilesSetDefsPanel_interesting_standardFileConflict(setName, customSetName),
1388 Bundle.FilesSetDefsPanel_interesting_newOwConflict(),
1389 JOptionPane.OK_CANCEL_OPTION,
1390 JOptionPane.QUESTION_MESSAGE,
1396 if (conflictChoice == JOptionPane.OK_OPTION) {
1400 return Pair.of(null, conflictChoice);
1403 @NbBundle.Messages({
"FilesSetDefsPanel.interesting.exportButtonAction.featureName=Interesting Files Set Export",
1404 "# {0} - file name",
1405 "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt=File {0} exists, overwrite?",
1406 "FilesSetDefsPanel.interesting.ExportedMsg=Interesting files set exported",
1407 "FilesSetDefsPanel.interesting.failExportMsg=Export of interesting files set failed"})
1411 JFileChooser chooser =
new JFileChooser();
1412 final String EXTENSION =
"xml";
1413 FileNameExtensionFilter autopsyFilter =
new FileNameExtensionFilter(
1414 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.fileExtensionFilterLbl"), EXTENSION);
1415 chooser.addChoosableFileFilter(autopsyFilter);
1416 chooser.setSelectedFile(
new File(this.setsList.getSelectedValue().getName()));
1417 chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
1418 int returnVal = chooser.showSaveDialog(
this);
1419 if (returnVal == JFileChooser.APPROVE_OPTION) {
1420 final String FEATURE_NAME = NbBundle.getMessage(this.getClass(),
1421 "FilesSetDefsPanel.interesting.exportButtonAction.featureName");
1422 File selFile = chooser.getSelectedFile();
1423 if (selFile == null) {
1424 JOptionPane.showMessageDialog(
this,
1425 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.failExportMsg"),
1427 JOptionPane.WARNING_MESSAGE);
1428 logger.warning(
"Selected file was null, when trying to export interesting files set definitions");
1432 String fileAbs = selFile.getAbsolutePath();
1433 if (!fileAbs.endsWith(
"." + EXTENSION)) {
1434 fileAbs = fileAbs +
"." + EXTENSION;
1435 selFile =
new File(fileAbs);
1437 if (selFile.exists()) {
1439 final String FILE_EXISTS_MESSAGE = NbBundle.getMessage(this.getClass(),
1440 "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt", selFile.getName());
1441 boolean shouldWrite = JOptionPane.showConfirmDialog(
this, FILE_EXISTS_MESSAGE, FEATURE_NAME, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION;
1446 List<FilesSet> exportSets;
1447 exportSets =
new ArrayList<>();
1449 exportSets.add(this.setsList.getSelectedValue());
1450 boolean written = InterestingItemsFilesSetSettings.exportXmlDefinitionsFile(selFile, exportSets);
1452 JOptionPane.showMessageDialog(
1453 WindowManager.getDefault().getMainWindow(),
1454 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.interesting.ExportedMsg"),
1456 JOptionPane.INFORMATION_MESSAGE);
1458 JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
1459 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.interesting.failExportMsg"),
1461 JOptionPane.WARNING_MESSAGE);
1462 logger.warning(
"Export of interesting files set failed unable to write definitions xml file");
Pair< FilesSet, Integer > onNewEditSetConflict(FilesSet set)
javax.swing.JLabel setDetailsLabel
void replaceFilesSet(FilesSet oldSet, FilesSet newSet, Map< String, FilesSet.Rule > rules)
javax.swing.JLabel mimeTypeLabel
void deleteRuleButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JLabel daysIncludedLabel
javax.swing.JPanel jPanel1
javax.swing.JLabel nameLabel
static synchronized IngestManager getInstance()
javax.swing.JRadioButton fileNameExtensionRadioButton
javax.swing.JComboBox< String > fileSizeUnitComboBox
void valueChanged(ListSelectionEvent e)
javax.swing.JButton importSetButton
void editSetButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JTextField fileNameTextField
javax.swing.JButton copySetButton
javax.swing.JLabel modifiedDateLabel
javax.swing.JLabel fileSizeLabel
javax.swing.JButton exportSetButton
Pair< FilesSet, Integer > handleConflict(FilesSet set, boolean isImport)
Map< String, FilesSet > getInterestingFilesSets()
void deleteSetButtonActionPerformed(java.awt.event.ActionEvent evt)
final DefaultListModel< FilesSet > setsListModel
javax.swing.JLabel pathLabel
void editRuleButtonActionPerformed(java.awt.event.ActionEvent evt)
void exportSetButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JScrollPane rulesListScrollPane
javax.swing.JTextArea descriptionTextArea
boolean isIngestRunning()
javax.swing.JScrollPane setDescScrollPanel
javax.swing.JButton newSetButton
javax.swing.JLabel rulesListLabel
static synchronized FilesSetsManager getInstance()
javax.swing.JScrollPane setsListScrollPane
void copySetButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JList< FilesSet > setsList
Map< String, FilesSet > getCustomFileIngestFilters()
javax.swing.JSpinner fileSizeSpinner
FilesSet determineFilesToImport(Collection< FilesSet > importedSets)
javax.swing.ButtonGroup fileNameButtonGroup
void doFilesSetRuleDialog(FilesSet.Rule selectedRule)
javax.swing.JCheckBox ignoreKnownFilesCheckbox
javax.swing.JLabel setsListLabel
javax.swing.JCheckBox ingoreUnallocCheckbox
Pair< FilesSet, Integer > onNewEditSetStandardSetConflict(FilesSet set)
void addIngestJobEventListener(final PropertyChangeListener listener)
javax.swing.JScrollPane descriptionScrollPane
void newRuleButtonActionPerformed(java.awt.event.ActionEvent evt)
FilesSetDefsPanel(PANEL_TYPE panelType)
static synchronized List< IngestProfile > getIngestProfiles()
javax.swing.JTextField daysIncludedTextField
javax.swing.JButton newRuleButton
void doFileSetsDialog(FilesSet selectedSet, boolean shouldCreateNew)
void valueChanged(ListSelectionEvent e)
void importSetButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JButton deleteSetButton
javax.swing.JRadioButton filesRadioButton
javax.swing.JLabel descriptionLabel
Map< String, Rule > getRules()
Pair< FilesSet, Integer > onImportConflict(FilesSet set)
javax.swing.JTextArea setDescriptionTextArea
javax.swing.JButton editSetButton
final String ruleDialogTitle
javax.swing.JCheckBox rulePathConditionRegexCheckBox
javax.swing.JSeparator separator
void fileNameRegexCheckboxActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JCheckBox fileNameRegexCheckbox
void resetRuleComponents()
TreeMap< String, FilesSet > filesSets
javax.swing.JRadioButton dirsRadioButton
javax.swing.JRadioButton allRadioButton
javax.swing.JComboBox< String > equalitySignComboBox
boolean ignoresKnownFiles()
synchronized static Logger getLogger(String name)
javax.swing.JLabel ruleLabel
javax.swing.JLabel fileTypeLabel
final PANEL_TYPE panelType
javax.swing.JButton deleteRuleButton
javax.swing.JButton editRuleButton
javax.swing.JLabel ingestWarningLabel
final String filterDialogTitle
void newSetButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JTextField rulePathConditionTextField
javax.swing.JComboBox< String > mimeTypeComboBox
boolean ingoresUnallocatedSpace()
static synchronized SortedSet< String > getDetectedTypes()
javax.swing.JRadioButton fileNameRadioButton
Pair< FilesSet, Integer > onImportStandardSetConflict(FilesSet set)
javax.swing.JScrollPane jScrollPane1
final DefaultListModel< FilesSet.Rule > rulesListModel
javax.swing.JList< FilesSet.Rule > rulesList
static void error(String message)
javax.swing.ButtonGroup typeButtonGroup