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 javax.swing.DefaultListModel;
34 import javax.swing.JButton;
35 import javax.swing.JFileChooser;
36 import javax.swing.JOptionPane;
37 import javax.swing.event.ListSelectionEvent;
38 import javax.swing.event.ListSelectionListener;
39 import javax.swing.filechooser.FileNameExtensionFilter;
40 import org.netbeans.spi.options.OptionsPanelController;
41 import org.openide.util.NbBundle;
42 import org.openide.windows.WindowManager;
54 @SuppressWarnings(
"PMD.SingularField")
57 private static final long serialVersionUID = 1L;
59 @NbBundle.Messages({
"# {0} - filter name",
60 "# {1} - profile name",
61 "FilesSetDefsPanel.ingest.fileFilterInUseError=The selected file filter, {0}, is being used by a profile, {1}, and cannot be deleted while any profile uses it.",
62 "FilesSetDefsPanel.bytes=Bytes",
63 "FilesSetDefsPanel.kiloBytes=Kilobytes",
64 "FilesSetDefsPanel.megaBytes=Megabytes",
65 "FilesSetDefsPanel.gigaBytes=Gigabytes",
66 "FilesSetDefsPanel.loadError=Error loading interesting files sets from file.",
67 "FilesSetDefsPanel.saveError=Error saving interesting files sets to file.",
68 "FilesSetDefsPanel.interesting.copySetButton.text=Copy Set",
69 "FilesSetDefsPanel.interesting.importSetButton.text=Import Set",
70 "FilesSetDefsPanel.interesting.exportSetButton.text=Export Set"
77 private final DefaultListModel<FilesSet> setsListModel =
new DefaultListModel<>();
78 private final DefaultListModel<
FilesSet.
Rule> rulesListModel =
new DefaultListModel<>();
80 private final JButton okButton =
new JButton(
"OK");
81 private final JButton cancelButton =
new JButton(
"Cancel");
85 private boolean canBeEnabled =
true;
100 this.panelType = panelType;
101 this.initComponents();
103 this.setsList.setModel(setsListModel);
105 this.rulesList.setModel(rulesListModel);
107 this.ingestWarningLabel.setVisible(
false);
109 this.copySetButton.setVisible(
false);
110 this.importSetButton.setVisible(
false);
111 this.exportSetButton.setVisible(
false);
112 this.mimeTypeComboBox.setVisible(
false);
113 this.mimeTypeLabel.setVisible(
false);
114 this.fileSizeUnitComboBox.setVisible(
false);
115 this.fileSizeSpinner.setVisible(
false);
116 this.filterDialogTitle =
"FilesSetPanel.filter.title";
117 this.ruleDialogTitle =
"FilesSetPanel.rule.title";
118 this.fileSizeLabel.setVisible(
false);
119 this.equalitySignComboBox.setVisible(
false);
120 this.ignoreKnownFilesCheckbox.setVisible(
false);
121 this.fileTypeLabel.setVisible(
false);
122 this.filesRadioButton.setVisible(
false);
123 this.dirsRadioButton.setVisible(
false);
124 this.allRadioButton.setVisible(
false);
125 this.descriptionTextArea.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.jTextArea1.text"));
126 org.openide.awt.Mnemonics.setLocalizedText(setsListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.setsListLabel.text"));
127 org.openide.awt.Mnemonics.setLocalizedText(editSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.editSetButton.text"));
128 org.openide.awt.Mnemonics.setLocalizedText(newSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.newSetButton.text"));
129 org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.deleteSetButton.text"));
130 org.openide.awt.Mnemonics.setLocalizedText(setDetailsLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.jLabel6.text"));
132 this.filterDialogTitle =
"FilesSetPanel.interesting.title";
133 this.ruleDialogTitle =
"FilesSetPanel.interesting.title";
134 this.ingoreUnallocCheckbox.setVisible(
false);
138 @NbBundle.Messages({
"FilesSetDefsPanel.Interesting.Title=Global Interesting Items Settings",
139 "FilesSetDefsPanel.Ingest.Title=File Filter Settings"})
142 setName(Bundle.FilesSetDefsPanel_Ingest_Title());
144 setName(Bundle.FilesSetDefsPanel_Interesting_Title());
149 detectableMimeTypes.forEach((type) -> {
150 mimeTypeComboBox.addItem(type);
153 logger.log(Level.SEVERE,
"Unable to get detectable file types", ex);
156 this.fileSizeUnitComboBox.setSelectedIndex(1);
157 this.equalitySignComboBox.setSelectedIndex(2);
171 logger.log(Level.WARNING, Bundle.FilesSetDefsPanel_saveError(), ex);
178 canBeEnabled = isEnabled;
179 newRuleButton.setEnabled(isEnabled);
180 copySetButton.setEnabled(isEnabled && setSelected);
181 newSetButton.setEnabled(isEnabled);
182 editRuleButton.setEnabled(isEnabled && ruleSelected);
183 editSetButton.setEnabled(isEnabled && setSelected);
184 exportSetButton.setEnabled(setSelected);
185 importSetButton.setEnabled(isEnabled);
186 deleteRuleButton.setEnabled(isEnabled && ruleSelected);
187 deleteSetButton.setEnabled(isEnabled && setSelected);
188 ingestWarningLabel.setVisible(!isEnabled);
198 this.resetComponents();
211 logger.log(Level.WARNING, Bundle.FilesSetDefsPanel_loadError(), ex);
212 this.filesSets =
new TreeMap<>();
217 this.filesSets.values().forEach((set) -> {
218 this.setsListModel.addElement(set);
221 if (!this.filesSets.isEmpty()) {
224 EventQueue.invokeLater(() -> {
234 this.resetRuleComponents();
235 this.setsListModel.clear();
236 this.setDescriptionTextArea.setText(
"");
237 this.ignoreKnownFilesCheckbox.setSelected(
true);
238 this.ingoreUnallocCheckbox.setSelected(
true);
239 this.newSetButton.setEnabled(
true && canBeEnabled);
240 this.editSetButton.setEnabled(
false);
241 this.copySetButton.setEnabled(
false);
242 this.exportSetButton.setEnabled(
false);
243 this.importSetButton.setEnabled(
true && canBeEnabled);
244 this.deleteSetButton.setEnabled(
false);
252 this.fileNameTextField.setText(
"");
253 this.fileNameRadioButton.setSelected(
true);
254 this.fileNameRegexCheckbox.setSelected(
false);
255 this.filesRadioButton.setSelected(
true);
256 this.rulePathConditionTextField.setText(
"");
257 this.daysIncludedTextField.setText(
"");
258 this.rulePathConditionRegexCheckBox.setSelected(
false);
259 this.mimeTypeComboBox.setSelectedIndex(0);
260 this.equalitySignComboBox.setSelectedIndex(2);
261 this.fileSizeUnitComboBox.setSelectedIndex(1);
262 this.fileSizeSpinner.setValue(0);
263 this.newRuleButton.setEnabled(!this.setsListModel.isEmpty() && canBeEnabled);
264 this.editRuleButton.setEnabled(
false);
265 this.deleteRuleButton.setEnabled(
false);
275 if (e.getValueIsAdjusting()) {
288 if (selectedSet != null) {
301 Collections.sort(rules,
new Comparator<FilesSet.Rule>() {
304 return rule1.toString().compareTo(rule2.toString());
307 rules.forEach((rule) -> {
333 if (e.getValueIsAdjusting()) {
349 if (nameCondition != null) {
360 switch (typeCondition.getMetaType()) {
367 case FILES_AND_DIRECTORIES:
371 if (pathCondition != null) {
378 if (mimeTypeCondition != null) {
383 if (fileSizeCondition != null) {
392 if (dateCondition != null){
423 if (selectedSet != null) {
434 int option = JOptionPane.OK_OPTION;
436 option = JOptionPane.showConfirmDialog(
this, panel, NbBundle.getMessage(
FilesSetPanel.class, filterDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
437 }
while (option == JOptionPane.OK_OPTION && !panel.isValidDefinition());
441 if (this.filesSets.containsKey(panel.getFilesSetName()) && shouldCreateNew) {
443 "FilesSetDefsPanel.doFileSetsDialog.duplicateRuleSet.text",
444 panel.getFilesSetName()));
448 if (option == JOptionPane.OK_OPTION) {
450 if (selectedSet != null) {
454 rules.putAll(selectedSet.
getRules());
456 if (shouldCreateNew) {
457 this.replaceFilesSet(null, panel.getFilesSetName(), panel.getFilesSetDescription(), panel.getFileSetIgnoresKnownFiles(), panel.getFileSetIgnoresUnallocatedSpace(), rules);
459 this.replaceFilesSet(selectedSet, panel.getFilesSetName(), panel.getFilesSetDescription(), panel.getFileSetIgnoresKnownFiles(), panel.getFileSetIgnoresUnallocatedSpace(), rules);
473 FilesSetRulePanel panel;
474 if (selectedRule != null) {
476 panel =
new FilesSetRulePanel(selectedRule, okButton, cancelButton, panelType);
479 panel =
new FilesSetRulePanel(okButton, cancelButton, panelType);
484 int option = JOptionPane.OK_OPTION;
486 option = JOptionPane.showOptionDialog(
this, panel, NbBundle.getMessage(
FilesSetPanel.class, ruleDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null,
new Object[]{okButton, cancelButton}, okButton);
488 }
while (option == JOptionPane.OK_OPTION && !panel.isValidRuleDefinition());
490 if (option == JOptionPane.OK_OPTION) {
494 FilesSet selectedSet = this.setsList.getSelectedValue();
499 if (selectedRule != null) {
500 rules.remove(selectedRule.getUuid());
502 FilesSet.
Rule newRule =
new FilesSet.
Rule(panel.getRuleName(), panel.getFileNameCondition(), panel.getMetaTypeCondition(), panel.getPathCondition(), panel.getMimeTypeCondition(), panel.getFileSizeCondition(), panel.getDateCondition());
503 rules.put(newRule.getUuid(), newRule);
512 EventQueue.invokeLater(() -> {
513 this.rulesList.setSelectedValue(newRule,
true);
533 void replaceFilesSet(
FilesSet oldSet, String name, String description,
boolean ignoresKnownFiles,
boolean ignoresUnallocatedSpace, Map<String, FilesSet.Rule> rules) {
534 if (oldSet != null) {
537 this.filesSets.remove(oldSet.
getName());
542 FilesSet newSet =
new FilesSet(name, description, ignoresKnownFiles, ignoresUnallocatedSpace, rules);
543 this.filesSets.put(newSet.getName(), newSet);
547 FilesSetDefsPanel.this.setsListModel.clear();
548 this.filesSets.values().forEach((set) -> {
549 this.setsListModel.addElement(set);
555 this.setsList.setSelectedValue(newSet,
true);
563 @SuppressWarnings(
"unchecked")
565 private
void initComponents() {
567 fileNameButtonGroup =
new javax.swing.ButtonGroup();
568 typeButtonGroup =
new javax.swing.ButtonGroup();
569 jScrollPane1 =
new javax.swing.JScrollPane();
570 jPanel1 =
new javax.swing.JPanel();
571 setDetailsLabel =
new javax.swing.JLabel();
572 newRuleButton =
new javax.swing.JButton();
573 filesRadioButton =
new javax.swing.JRadioButton();
574 editRuleButton =
new javax.swing.JButton();
575 rulesListLabel =
new javax.swing.JLabel();
576 rulesListScrollPane =
new javax.swing.JScrollPane();
577 rulesList =
new javax.swing.JList<>();
578 setDescScrollPanel =
new javax.swing.JScrollPane();
579 setDescriptionTextArea =
new javax.swing.JTextArea();
580 editSetButton =
new javax.swing.JButton();
581 setsListScrollPane =
new javax.swing.JScrollPane();
582 setsList =
new javax.swing.JList<>();
583 fileNameExtensionRadioButton =
new javax.swing.JRadioButton();
584 nameLabel =
new javax.swing.JLabel();
585 fileNameTextField =
new javax.swing.JTextField();
586 descriptionLabel =
new javax.swing.JLabel();
587 fileNameRadioButton =
new javax.swing.JRadioButton();
588 rulePathConditionTextField =
new javax.swing.JTextField();
589 ignoreKnownFilesCheckbox =
new javax.swing.JCheckBox();
590 fileNameRegexCheckbox =
new javax.swing.JCheckBox();
591 separator =
new javax.swing.JSeparator();
592 setsListLabel =
new javax.swing.JLabel();
593 allRadioButton =
new javax.swing.JRadioButton();
594 deleteSetButton =
new javax.swing.JButton();
595 deleteRuleButton =
new javax.swing.JButton();
596 newSetButton =
new javax.swing.JButton();
597 fileTypeLabel =
new javax.swing.JLabel();
598 dirsRadioButton =
new javax.swing.JRadioButton();
599 ruleLabel =
new javax.swing.JLabel();
600 pathLabel =
new javax.swing.JLabel();
601 rulePathConditionRegexCheckBox =
new javax.swing.JCheckBox();
602 descriptionScrollPane =
new javax.swing.JScrollPane();
603 descriptionTextArea =
new javax.swing.JTextArea();
604 mimeTypeLabel =
new javax.swing.JLabel();
605 mimeTypeComboBox =
new javax.swing.JComboBox<>();
606 fileSizeLabel =
new javax.swing.JLabel();
607 equalitySignComboBox =
new javax.swing.JComboBox<String>();
608 fileSizeSpinner =
new javax.swing.JSpinner();
609 fileSizeUnitComboBox =
new javax.swing.JComboBox<String>();
610 ingoreUnallocCheckbox =
new javax.swing.JCheckBox();
611 ingestWarningLabel =
new javax.swing.JLabel();
612 copySetButton =
new javax.swing.JButton();
613 importSetButton =
new javax.swing.JButton();
614 exportSetButton =
new javax.swing.JButton();
615 modifiedDateLabel =
new javax.swing.JLabel();
616 daysIncludedTextField =
new javax.swing.JTextField();
617 daysIncludedLabel =
new javax.swing.JLabel();
619 org.openide.awt.Mnemonics.setLocalizedText(setDetailsLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.jLabel6.text"));
621 newRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
622 org.openide.awt.Mnemonics.setLocalizedText(newRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.newRuleButton.text"));
623 newRuleButton.addActionListener(
new java.awt.event.ActionListener() {
624 public void actionPerformed(java.awt.event.ActionEvent evt) {
625 newRuleButtonActionPerformed(evt);
629 typeButtonGroup.add(filesRadioButton);
630 filesRadioButton.setSelected(
true);
631 org.openide.awt.Mnemonics.setLocalizedText(filesRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.filesRadioButton.text"));
632 filesRadioButton.setEnabled(
false);
634 editRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/edit16.png")));
635 org.openide.awt.Mnemonics.setLocalizedText(editRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.editRuleButton.text"));
636 editRuleButton.setEnabled(
false);
637 editRuleButton.addActionListener(
new java.awt.event.ActionListener() {
638 public void actionPerformed(java.awt.event.ActionEvent evt) {
639 editRuleButtonActionPerformed(evt);
643 org.openide.awt.Mnemonics.setLocalizedText(rulesListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulesListLabel.text"));
645 rulesList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
646 rulesListScrollPane.setViewportView(rulesList);
648 setDescScrollPanel.setMinimumSize(
new java.awt.Dimension(10, 22));
649 setDescScrollPanel.setPreferredSize(
new java.awt.Dimension(14, 40));
651 setDescriptionTextArea.setEditable(
false);
652 setDescriptionTextArea.setBackground(
new java.awt.Color(240, 240, 240));
653 setDescriptionTextArea.setColumns(20);
654 setDescriptionTextArea.setLineWrap(
true);
655 setDescriptionTextArea.setRows(6);
656 setDescriptionTextArea.setMinimumSize(
new java.awt.Dimension(10, 22));
657 setDescriptionTextArea.setOpaque(
false);
658 setDescScrollPanel.setViewportView(setDescriptionTextArea);
660 editSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/edit16.png")));
661 org.openide.awt.Mnemonics.setLocalizedText(editSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.editSetButton.text"));
662 editSetButton.setEnabled(
false);
663 editSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
664 editSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
665 editSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
666 editSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
667 editSetButton.addActionListener(
new java.awt.event.ActionListener() {
668 public void actionPerformed(java.awt.event.ActionEvent evt) {
669 editSetButtonActionPerformed(evt);
673 setsList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
674 setsListScrollPane.setViewportView(setsList);
676 fileNameButtonGroup.add(fileNameExtensionRadioButton);
677 org.openide.awt.Mnemonics.setLocalizedText(fileNameExtensionRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameExtensionRadioButton.text"));
678 fileNameExtensionRadioButton.setEnabled(
false);
680 org.openide.awt.Mnemonics.setLocalizedText(nameLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.nameLabel.text"));
682 fileNameTextField.setEditable(
false);
683 fileNameTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameTextField.text"));
685 org.openide.awt.Mnemonics.setLocalizedText(descriptionLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.descriptionLabel.text"));
687 fileNameButtonGroup.add(fileNameRadioButton);
688 org.openide.awt.Mnemonics.setLocalizedText(fileNameRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameRadioButton.text"));
689 fileNameRadioButton.setEnabled(
false);
691 rulePathConditionTextField.setEditable(
false);
692 rulePathConditionTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulePathConditionTextField.text"));
694 org.openide.awt.Mnemonics.setLocalizedText(ignoreKnownFilesCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ignoreKnownFilesCheckbox.text"));
695 ignoreKnownFilesCheckbox.setEnabled(
false);
697 org.openide.awt.Mnemonics.setLocalizedText(fileNameRegexCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameRegexCheckbox.text"));
698 fileNameRegexCheckbox.setEnabled(
false);
699 fileNameRegexCheckbox.addActionListener(
new java.awt.event.ActionListener() {
700 public void actionPerformed(java.awt.event.ActionEvent evt) {
701 fileNameRegexCheckboxActionPerformed(evt);
705 separator.setOrientation(javax.swing.SwingConstants.VERTICAL);
707 org.openide.awt.Mnemonics.setLocalizedText(setsListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.setsListLabel.text"));
709 typeButtonGroup.add(allRadioButton);
710 org.openide.awt.Mnemonics.setLocalizedText(allRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.allRadioButton.text"));
711 allRadioButton.setEnabled(
false);
713 deleteSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
714 org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.deleteSetButton.text"));
715 deleteSetButton.setEnabled(
false);
716 deleteSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
717 deleteSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
718 deleteSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
719 deleteSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
720 deleteSetButton.addActionListener(
new java.awt.event.ActionListener() {
721 public void actionPerformed(java.awt.event.ActionEvent evt) {
722 deleteSetButtonActionPerformed(evt);
726 deleteRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
727 org.openide.awt.Mnemonics.setLocalizedText(deleteRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.deleteRuleButton.text"));
728 deleteRuleButton.setEnabled(
false);
729 deleteRuleButton.addActionListener(
new java.awt.event.ActionListener() {
730 public void actionPerformed(java.awt.event.ActionEvent evt) {
731 deleteRuleButtonActionPerformed(evt);
735 newSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
736 org.openide.awt.Mnemonics.setLocalizedText(newSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.newSetButton.text"));
737 newSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
738 newSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
739 newSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
740 newSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
741 newSetButton.addActionListener(
new java.awt.event.ActionListener() {
742 public void actionPerformed(java.awt.event.ActionEvent evt) {
743 newSetButtonActionPerformed(evt);
747 org.openide.awt.Mnemonics.setLocalizedText(fileTypeLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileTypeLabel.text"));
749 typeButtonGroup.add(dirsRadioButton);
750 org.openide.awt.Mnemonics.setLocalizedText(dirsRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.dirsRadioButton.text"));
751 dirsRadioButton.setEnabled(
false);
753 org.openide.awt.Mnemonics.setLocalizedText(ruleLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ruleLabel.text"));
755 org.openide.awt.Mnemonics.setLocalizedText(pathLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.pathLabel.text"));
757 org.openide.awt.Mnemonics.setLocalizedText(rulePathConditionRegexCheckBox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulePathConditionRegexCheckBox.text"));
758 rulePathConditionRegexCheckBox.setEnabled(
false);
760 descriptionTextArea.setEditable(
false);
761 descriptionTextArea.setBackground(
new java.awt.Color(240, 240, 240));
762 descriptionTextArea.setColumns(20);
763 descriptionTextArea.setLineWrap(
true);
764 descriptionTextArea.setRows(3);
765 descriptionTextArea.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.jTextArea1.text"));
766 descriptionTextArea.setWrapStyleWord(
true);
767 descriptionTextArea.setOpaque(
false);
768 descriptionScrollPane.setViewportView(descriptionTextArea);
770 org.openide.awt.Mnemonics.setLocalizedText(mimeTypeLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.mimeTypeLabel.text"));
772 mimeTypeComboBox.setBackground(
new java.awt.Color(240, 240, 240));
773 mimeTypeComboBox.setEditable(
true);
774 mimeTypeComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] {
""}));
775 mimeTypeComboBox.setEnabled(
false);
776 mimeTypeComboBox.setMinimumSize(
new java.awt.Dimension(0, 20));
777 mimeTypeComboBox.setPreferredSize(
new java.awt.Dimension(12, 20));
779 org.openide.awt.Mnemonics.setLocalizedText(fileSizeLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileSizeLabel.text"));
781 equalitySignComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] {
"=",
">",
"≥",
"<",
"≤" }));
782 equalitySignComboBox.setEnabled(
false);
784 fileSizeSpinner.setEnabled(
false);
785 fileSizeSpinner.setMinimumSize(
new java.awt.Dimension(2, 20));
787 fileSizeUnitComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] { Bundle.FilesSetDefsPanel_bytes(), Bundle.FilesSetDefsPanel_kiloBytes(), Bundle.FilesSetDefsPanel_megaBytes(), Bundle.FilesSetDefsPanel_gigaBytes() }));
788 fileSizeUnitComboBox.setEnabled(
false);
790 org.openide.awt.Mnemonics.setLocalizedText(ingoreUnallocCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingoreUnallocCheckbox.text"));
791 ingoreUnallocCheckbox.setToolTipText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingoreUnallocCheckbox.toolTipText"));
792 ingoreUnallocCheckbox.setEnabled(
false);
794 ingestWarningLabel.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png")));
795 org.openide.awt.Mnemonics.setLocalizedText(ingestWarningLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingestWarningLabel.text"));
797 copySetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/new16.png")));
798 org.openide.awt.Mnemonics.setLocalizedText(copySetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.copySetButton.text"));
799 copySetButton.setEnabled(
false);
800 copySetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
801 copySetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
802 copySetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
803 copySetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
804 copySetButton.addActionListener(
new java.awt.event.ActionListener() {
805 public void actionPerformed(java.awt.event.ActionEvent evt) {
806 copySetButtonActionPerformed(evt);
810 importSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/import16.png")));
811 org.openide.awt.Mnemonics.setLocalizedText(importSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.importSetButton.text"));
812 importSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
813 importSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
814 importSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
815 importSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
816 importSetButton.addActionListener(
new java.awt.event.ActionListener() {
817 public void actionPerformed(java.awt.event.ActionEvent evt) {
818 importSetButtonActionPerformed(evt);
822 exportSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/export16.png")));
823 org.openide.awt.Mnemonics.setLocalizedText(exportSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.exportSetButton.text"));
824 exportSetButton.setEnabled(
false);
825 exportSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
826 exportSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
827 exportSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
828 exportSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
829 exportSetButton.addActionListener(
new java.awt.event.ActionListener() {
830 public void actionPerformed(java.awt.event.ActionEvent evt) {
831 exportSetButtonActionPerformed(evt);
835 org.openide.awt.Mnemonics.setLocalizedText(modifiedDateLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.modifiedDateLabel.text"));
837 daysIncludedTextField.setEditable(
false);
838 daysIncludedTextField.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
839 daysIncludedTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.daysIncludedTextField.text"));
840 daysIncludedTextField.setMinimumSize(
new java.awt.Dimension(60, 20));
841 daysIncludedTextField.setPreferredSize(
new java.awt.Dimension(60, 20));
843 org.openide.awt.Mnemonics.setLocalizedText(daysIncludedLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.daysIncludedLabel.text"));
844 daysIncludedLabel.setEnabled(
false);
846 javax.swing.GroupLayout jPanel1Layout =
new javax.swing.GroupLayout(jPanel1);
847 jPanel1.setLayout(jPanel1Layout);
848 jPanel1Layout.setHorizontalGroup(
849 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
850 .addGroup(jPanel1Layout.createSequentialGroup()
852 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
853 .addGroup(jPanel1Layout.createSequentialGroup()
854 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
false)
855 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
856 .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
857 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
858 .addComponent(importSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
859 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
860 .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
861 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
862 .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
863 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
864 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
865 .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
866 .addComponent(deleteSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
867 .addComponent(setsListScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
868 .addComponent(descriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
869 .addComponent(setsListLabel))
870 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
871 .addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
872 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
873 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
874 .addGroup(jPanel1Layout.createSequentialGroup()
875 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
876 .addComponent(rulesListScrollPane, javax.swing.GroupLayout.Alignment.TRAILING)
877 .addComponent(setDescScrollPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
878 .addGroup(jPanel1Layout.createSequentialGroup()
880 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
881 .addComponent(mimeTypeLabel)
882 .addComponent(fileSizeLabel)
883 .addComponent(fileTypeLabel)
884 .addComponent(pathLabel)
885 .addComponent(modifiedDateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
886 .addComponent(nameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
887 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
888 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
889 .addComponent(rulePathConditionTextField)
890 .addComponent(fileNameTextField, javax.swing.GroupLayout.Alignment.TRAILING)
891 .addComponent(mimeTypeComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
892 .addGroup(jPanel1Layout.createSequentialGroup()
893 .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
894 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
895 .addComponent(fileSizeSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
896 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
897 .addComponent(fileSizeUnitComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
898 .addGroup(jPanel1Layout.createSequentialGroup()
899 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
900 .addComponent(rulePathConditionRegexCheckBox)
901 .addGroup(jPanel1Layout.createSequentialGroup()
902 .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
903 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
904 .addComponent(daysIncludedLabel))
905 .addGroup(jPanel1Layout.createSequentialGroup()
906 .addComponent(filesRadioButton)
907 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
908 .addComponent(dirsRadioButton)
909 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
910 .addComponent(allRadioButton))
911 .addGroup(jPanel1Layout.createSequentialGroup()
912 .addComponent(fileNameRadioButton)
913 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
914 .addComponent(fileNameExtensionRadioButton)
915 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
916 .addComponent(fileNameRegexCheckbox)))
917 .addGap(0, 0, Short.MAX_VALUE)))))
919 .addGroup(jPanel1Layout.createSequentialGroup()
920 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
921 .addComponent(rulesListLabel)
922 .addGroup(jPanel1Layout.createSequentialGroup()
923 .addComponent(ignoreKnownFilesCheckbox)
924 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
925 .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
926 .addGroup(jPanel1Layout.createSequentialGroup()
927 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
928 .addComponent(descriptionLabel)
929 .addComponent(setDetailsLabel))
930 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
931 .addComponent(ingestWarningLabel))
932 .addComponent(ruleLabel)
933 .addGroup(jPanel1Layout.createSequentialGroup()
934 .addComponent(newRuleButton)
936 .addComponent(editRuleButton)
938 .addComponent(deleteRuleButton)))
939 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
942 jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {copySetButton, deleteSetButton, editSetButton, exportSetButton, importSetButton, newSetButton});
944 jPanel1Layout.setVerticalGroup(
945 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
946 .addGroup(jPanel1Layout.createSequentialGroup()
948 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
949 .addComponent(separator)
950 .addGroup(jPanel1Layout.createSequentialGroup()
951 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
952 .addGroup(jPanel1Layout.createSequentialGroup()
953 .addComponent(setDetailsLabel)
954 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
955 .addComponent(descriptionLabel)
957 .addComponent(ingestWarningLabel, javax.swing.GroupLayout.Alignment.TRAILING))
958 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
959 .addComponent(setDescScrollPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
960 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
961 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
962 .addComponent(ignoreKnownFilesCheckbox)
963 .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
964 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
965 .addComponent(rulesListLabel)
966 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
967 .addComponent(rulesListScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE)
968 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
969 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
970 .addComponent(newRuleButton)
971 .addComponent(editRuleButton)
972 .addComponent(deleteRuleButton))
973 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
974 .addComponent(ruleLabel)
975 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
976 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
977 .addComponent(fileTypeLabel)
978 .addComponent(filesRadioButton)
979 .addComponent(dirsRadioButton)
980 .addComponent(allRadioButton))
981 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
982 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
983 .addComponent(nameLabel)
984 .addComponent(fileNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
985 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
986 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
987 .addComponent(fileNameRadioButton)
988 .addComponent(fileNameExtensionRadioButton)
989 .addComponent(fileNameRegexCheckbox))
990 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
991 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
992 .addComponent(pathLabel)
993 .addComponent(rulePathConditionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
994 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
995 .addComponent(rulePathConditionRegexCheckBox)
996 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
997 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
998 .addComponent(mimeTypeLabel)
999 .addComponent(mimeTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1000 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1001 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1002 .addComponent(fileSizeLabel)
1003 .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1004 .addComponent(fileSizeSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1005 .addComponent(fileSizeUnitComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1006 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1007 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1008 .addComponent(modifiedDateLabel)
1009 .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1010 .addComponent(daysIncludedLabel))
1012 .addGroup(jPanel1Layout.createSequentialGroup()
1013 .addComponent(descriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1014 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1015 .addComponent(setsListLabel)
1016 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1017 .addComponent(setsListScrollPane)
1018 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1019 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1020 .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1021 .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1022 .addComponent(deleteSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1023 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1024 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1025 .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1026 .addComponent(importSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1027 .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1031 jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL,
new java.awt.Component[] {copySetButton, deleteRuleButton, deleteSetButton, editRuleButton, editSetButton, exportSetButton, importSetButton, newRuleButton, newSetButton});
1033 jScrollPane1.setViewportView(jPanel1);
1035 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
1036 this.setLayout(layout);
1037 layout.setHorizontalGroup(
1038 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1039 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE)
1041 layout.setVerticalGroup(
1042 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1043 .addComponent(jScrollPane1)
1048 this.doFileSetsDialog(null,
true);
1049 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1057 FilesSet oldSet = this.setsList.getSelectedValue();
1059 FilesSet.
Rule selectedRule = this.rulesList.getSelectedValue();
1060 rules.remove(selectedRule.getUuid());
1062 if (!this.rulesListModel.isEmpty()) {
1063 this.rulesList.setSelectedIndex(0);
1065 this.resetRuleComponents();
1067 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1071 FilesSet selectedSet = this.setsList.getSelectedValue();
1074 if (profile.getFileIngestFilter().equals(selectedSet.
getName())) {
1076 "FilesSetDefsPanel.ingest.fileFilterInUseError",
1077 selectedSet.
getName(), profile.toString()));
1083 this.filesSets.remove(selectedSet.
getName());
1084 this.setsListModel.removeElement(selectedSet);
1087 if (!this.filesSets.isEmpty()) {
1088 this.setsList.setSelectedIndex(0);
1090 this.resetComponents();
1092 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1096 this.doFileSetsDialog(this.setsList.getSelectedValue(),
false);
1097 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1101 this.doFilesSetRuleDialog(this.rulesList.getSelectedValue());
1102 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1106 this.doFilesSetRuleDialog(null);
1107 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1111 this.doFileSetsDialog(this.setsList.getSelectedValue(),
true);
1112 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1114 @NbBundle.Messages({
1115 "FilesSetDefsPanel.yesOwMsg=Yes, overwrite",
1116 "FilesSetDefsPanel.noSkipMsg=No, skip",
1117 "FilesSetDefsPanel.cancelImportMsg=Cancel import",
1118 "# {0} - FilesSet name",
1119 "FilesSetDefsPanel.interesting.overwriteSetPrompt=Interesting files set <{0}> already exists locally, overwrite?",
1120 "FilesSetDefsPanel.interesting.importOwConflict=Import Interesting files set conflict",
1121 "FilesSetDefsPanel.interesting.failImportMsg=Interesting files set not imported",
1122 "FilesSetDefsPanel.interesting.fileExtensionFilterLbl=Autopsy Interesting File Set File (xml)",
1123 "FilesSetDefsPanel.interesting.importButtonAction.featureName=Interesting Files Set Import"
1127 FilesSet selectedSet = this.setsList.getSelectedValue();
1128 JFileChooser chooser =
new JFileChooser();
1129 final String EXTENSION =
"xml";
1130 FileNameExtensionFilter autopsyFilter =
new FileNameExtensionFilter(
1131 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.fileExtensionFilterLbl"), EXTENSION);
1132 chooser.addChoosableFileFilter(autopsyFilter);
1133 chooser.setAcceptAllFileFilterUsed(
false);
1134 chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
1135 int returnVal = chooser.showOpenDialog(
this);
1136 if (returnVal == JFileChooser.APPROVE_OPTION) {
1137 File selFile = chooser.getSelectedFile();
1138 if (selFile == null) {
1139 JOptionPane.showMessageDialog(
this,
1140 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.failImportMsg"),
1141 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.importButtonAction.featureName"),
1142 JOptionPane.WARNING_MESSAGE);
1143 logger.warning(
"Selected file was null, when trying to import interesting files set definitions");
1146 Collection<FilesSet> importedSets;
1148 importedSets = InterestingItemsFilesSetSettings.readDefinitionsXML(selFile).values();
1149 if (importedSets.isEmpty()) {
1153 JOptionPane.showMessageDialog(
this,
1154 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.failImportMsg"),
1155 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.importButtonAction.featureName"),
1156 JOptionPane.WARNING_MESSAGE);
1157 logger.log(Level.WARNING,
"No Interesting files set definitions were read from the selected file, exception", ex);
1160 for (
FilesSet set : importedSets) {
1161 int choice = JOptionPane.OK_OPTION;
1162 if (filesSets.containsKey(set.getName())) {
1163 Object[] options = {NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.yesOwMsg"),
1164 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.noSkipMsg"),
1165 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.cancelImportMsg")};
1166 choice = JOptionPane.showOptionDialog(
this,
1167 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.overwriteSetPrompt", set.getName()),
1168 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.importOwConflict"),
1169 JOptionPane.YES_NO_CANCEL_OPTION,
1170 JOptionPane.QUESTION_MESSAGE,
1175 if (choice == JOptionPane.OK_OPTION) {
1177 this.filesSets.put(set.getName(), set);
1178 }
else if (choice == JOptionPane.CANCEL_OPTION) {
1184 this.filesSets.values().forEach((set) -> {
1185 this.setsListModel.addElement(set);
1190 this.setsList.setSelectedValue(selectedSet,
true);
1191 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1196 @NbBundle.Messages({
"FilesSetDefsPanel.interesting.exportButtonAction.featureName=Interesting Files Set Export",
1197 "# {0} - file name",
1198 "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt=File {0} exists, overwrite?",
1199 "FilesSetDefsPanel.interesting.ExportedMsg=Interesting files set exported",
1200 "FilesSetDefsPanel.interesting.failExportMsg=Export of interesting files set failed"})
1204 JFileChooser chooser =
new JFileChooser();
1205 final String EXTENSION =
"xml";
1206 FileNameExtensionFilter autopsyFilter =
new FileNameExtensionFilter(
1207 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.fileExtensionFilterLbl"), EXTENSION);
1208 chooser.addChoosableFileFilter(autopsyFilter);
1209 chooser.setSelectedFile(
new File(this.setsList.getSelectedValue().getName()));
1210 chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
1211 int returnVal = chooser.showSaveDialog(
this);
1212 if (returnVal == JFileChooser.APPROVE_OPTION) {
1213 final String FEATURE_NAME = NbBundle.getMessage(this.getClass(),
1214 "FilesSetDefsPanel.interesting.exportButtonAction.featureName");
1215 File selFile = chooser.getSelectedFile();
1216 if (selFile == null) {
1217 JOptionPane.showMessageDialog(
this,
1218 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.failExportMsg"),
1220 JOptionPane.WARNING_MESSAGE);
1221 logger.warning(
"Selected file was null, when trying to export interesting files set definitions");
1225 String fileAbs = selFile.getAbsolutePath();
1226 if (!fileAbs.endsWith(
"." + EXTENSION)) {
1227 fileAbs = fileAbs +
"." + EXTENSION;
1228 selFile =
new File(fileAbs);
1230 if (selFile.exists()) {
1232 final String FILE_EXISTS_MESSAGE = NbBundle.getMessage(this.getClass(),
1233 "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt", selFile.getName());
1234 boolean shouldWrite = JOptionPane.showConfirmDialog(
this, FILE_EXISTS_MESSAGE, FEATURE_NAME, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION;
1239 List<FilesSet> exportSets;
1240 exportSets =
new ArrayList<>();
1242 exportSets.add(this.setsList.getSelectedValue());
1243 boolean written = InterestingItemsFilesSetSettings.exportXmlDefinitionsFile(selFile, exportSets);
1245 JOptionPane.showMessageDialog(
1246 WindowManager.getDefault().getMainWindow(),
1247 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.interesting.ExportedMsg"),
1249 JOptionPane.INFORMATION_MESSAGE);
1251 JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
1252 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.interesting.failExportMsg"),
1254 JOptionPane.WARNING_MESSAGE);
1255 logger.warning(
"Export of interesting files set failed unable to write definitions xml file");
javax.swing.JLabel setDetailsLabel
javax.swing.JLabel mimeTypeLabel
void deleteRuleButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JLabel daysIncludedLabel
javax.swing.JPanel jPanel1
javax.swing.JLabel nameLabel
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
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
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
javax.swing.ButtonGroup fileNameButtonGroup
void doFilesSetRuleDialog(FilesSet.Rule selectedRule)
javax.swing.JCheckBox ignoreKnownFilesCheckbox
javax.swing.JLabel setsListLabel
javax.swing.JCheckBox ingoreUnallocCheckbox
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()
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
void enableButtons(boolean isEnabled)
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
javax.swing.JScrollPane jScrollPane1
final DefaultListModel< FilesSet.Rule > rulesListModel
javax.swing.JList< FilesSet.Rule > rulesList
static void error(String message)
javax.swing.ButtonGroup typeButtonGroup