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;
59 @SuppressWarnings(
"PMD.SingularField")
62 private static final long serialVersionUID = 1L;
64 @NbBundle.Messages({
"# {0} - filter name",
65 "# {1} - profile name",
66 "FilesSetDefsPanel.ingest.fileFilterInUseError=The selected file filter, {0}, is being used by a profile, {1}, and cannot be deleted while any profile uses it.",
67 "FilesSetDefsPanel.bytes=Bytes",
68 "FilesSetDefsPanel.kiloBytes=Kilobytes",
69 "FilesSetDefsPanel.megaBytes=Megabytes",
70 "FilesSetDefsPanel.gigaBytes=Gigabytes",
71 "FilesSetDefsPanel.loadError=Error loading interesting files sets from file.",
72 "FilesSetDefsPanel.saveError=Error saving interesting files sets to file.",
73 "FilesSetDefsPanel.interesting.copySetButton.text=Copy Set",
74 "FilesSetDefsPanel.interesting.importSetButton.text=Import Set",
75 "FilesSetDefsPanel.interesting.exportSetButton.text=Export Set"
82 private final DefaultListModel<FilesSet> setsListModel =
new DefaultListModel<>();
83 private final DefaultListModel<
FilesSet.
Rule> rulesListModel =
new DefaultListModel<>();
85 private final JButton okButton =
new JButton(
"OK");
86 private final JButton cancelButton =
new JButton(
"Cancel");
90 private boolean canBeEnabled =
true;
105 this.panelType = panelType;
106 this.initComponents();
109 this.setsList.setModel(setsListModel);
111 this.rulesList.setModel(rulesListModel);
113 this.ingestWarningLabel.setVisible(
false);
115 this.copySetButton.setVisible(
false);
116 this.importSetButton.setVisible(
false);
117 this.exportSetButton.setVisible(
false);
118 this.mimeTypeComboBox.setVisible(
false);
119 this.mimeTypeLabel.setVisible(
false);
120 this.fileSizeUnitComboBox.setVisible(
false);
121 this.fileSizeSpinner.setVisible(
false);
122 this.filterDialogTitle =
"FilesSetPanel.filter.title";
123 this.ruleDialogTitle =
"FilesSetPanel.rule.title";
124 this.fileSizeLabel.setVisible(
false);
125 this.equalitySignComboBox.setVisible(
false);
126 this.ignoreKnownFilesCheckbox.setVisible(
false);
127 this.fileTypeLabel.setVisible(
false);
128 this.filesRadioButton.setVisible(
false);
129 this.dirsRadioButton.setVisible(
false);
130 this.allRadioButton.setVisible(
false);
131 this.descriptionTextArea.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.jTextArea1.text"));
132 org.openide.awt.Mnemonics.setLocalizedText(setsListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.setsListLabel.text"));
133 org.openide.awt.Mnemonics.setLocalizedText(editSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.editSetButton.text"));
134 org.openide.awt.Mnemonics.setLocalizedText(newSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.newSetButton.text"));
135 org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.deleteSetButton.text"));
136 org.openide.awt.Mnemonics.setLocalizedText(setDetailsLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.jLabel6.text"));
138 this.filterDialogTitle =
"FilesSetPanel.interesting.title";
139 this.ruleDialogTitle =
"FilesSetPanel.interesting.title";
140 this.ingoreUnallocCheckbox.setVisible(
false);
151 @NbBundle.Messages({
"FilesSetDefsPanel.Interesting.Title=Global Interesting Items Settings",
152 "FilesSetDefsPanel.Ingest.Title=File Filter Settings"})
155 setName(Bundle.FilesSetDefsPanel_Ingest_Title());
157 setName(Bundle.FilesSetDefsPanel_Interesting_Title());
162 detectableMimeTypes.forEach((type) -> {
163 mimeTypeComboBox.addItem(type);
166 logger.log(Level.SEVERE,
"Unable to get detectable file types", ex);
169 this.fileSizeUnitComboBox.setSelectedIndex(1);
170 this.equalitySignComboBox.setSelectedIndex(2);
184 logger.log(Level.WARNING, Bundle.FilesSetDefsPanel_saveError(), ex);
189 FilesSet selectedFilesSet = this.setsList.getSelectedValue();
190 boolean setSelected = (selectedFilesSet != null);
191 boolean isStandardSet = (selectedFilesSet != null && selectedFilesSet.isStandardSet());
195 newRuleButton.setEnabled(canBeEnabled && !isStandardSet);
196 copySetButton.setEnabled(canBeEnabled && setSelected);
197 newSetButton.setEnabled(canBeEnabled);
198 editRuleButton.setEnabled(canBeEnabled && ruleSelected && !isStandardSet);
199 editSetButton.setEnabled(canBeEnabled && setSelected && !isStandardSet);
200 exportSetButton.setEnabled(setSelected);
201 importSetButton.setEnabled(canBeEnabled);
202 deleteRuleButton.setEnabled(canBeEnabled && ruleSelected && !isStandardSet);
203 deleteSetButton.setEnabled(canBeEnabled && setSelected && !isStandardSet);
204 ingestWarningLabel.setVisible(!canBeEnabled);
214 this.resetComponents();
227 logger.log(Level.WARNING, Bundle.FilesSetDefsPanel_loadError(), ex);
228 this.filesSets =
new TreeMap<>();
233 this.filesSets.values().forEach((set) -> {
234 this.setsListModel.addElement(set);
237 if (!this.filesSets.isEmpty()) {
240 EventQueue.invokeLater(() -> {
250 this.setsListModel.clear();
251 this.setDescriptionTextArea.setText(
"");
252 this.ignoreKnownFilesCheckbox.setSelected(
true);
253 this.ingoreUnallocCheckbox.setSelected(
true);
254 this.resetRuleComponents();
262 this.fileNameTextField.setText(
"");
263 this.fileNameRadioButton.setSelected(
true);
264 this.fileNameRegexCheckbox.setSelected(
false);
265 this.filesRadioButton.setSelected(
true);
266 this.rulePathConditionTextField.setText(
"");
267 this.daysIncludedTextField.setText(
"");
268 this.rulePathConditionRegexCheckBox.setSelected(
false);
269 this.mimeTypeComboBox.setSelectedIndex(0);
270 this.equalitySignComboBox.setSelectedIndex(2);
271 this.fileSizeUnitComboBox.setSelectedIndex(1);
272 this.fileSizeSpinner.setValue(0);
283 if (e.getValueIsAdjusting()) {
294 if (selectedSet != null) {
302 Collections.sort(rules,
new Comparator<FilesSet.Rule>() {
305 return rule1.toString().compareTo(rule2.toString());
308 rules.forEach((rule) -> {
327 if (e.getValueIsAdjusting()) {
343 if (nameCondition != null) {
354 switch (typeCondition.getMetaType()) {
361 case FILES_AND_DIRECTORIES:
365 if (pathCondition != null) {
372 if (mimeTypeCondition != null) {
377 if (fileSizeCondition != null) {
386 if (dateCondition != null) {
393 resetRuleComponents();
413 if (selectedSet != null) {
424 int option = JOptionPane.OK_OPTION;
426 option = JOptionPane.showConfirmDialog(
this, panel, NbBundle.getMessage(
FilesSetPanel.class, filterDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
427 }
while (option == JOptionPane.OK_OPTION && !panel.isValidDefinition());
429 if (option == JOptionPane.OK_OPTION) {
431 if (selectedSet != null) {
435 rules.putAll(selectedSet.
getRules());
439 panel.getFilesSetName(),
440 panel.getFilesSetDescription(),
441 panel.getFileSetIgnoresKnownFiles(),
442 panel.getFileSetIgnoresUnallocatedSpace(),
446 Pair<FilesSet, Integer> result = handleConflict(filesSet,
false);
447 option = result.getRight();
448 FilesSet toAddOrUpdate = result.getLeft();
450 if (result.getRight() == JOptionPane.OK_OPTION) {
451 if (shouldCreateNew) {
452 this.replaceFilesSet(null, toAddOrUpdate, null);
454 this.replaceFilesSet(selectedSet, toAddOrUpdate, null);
469 FilesSetRulePanel panel;
470 if (selectedRule != null) {
472 panel =
new FilesSetRulePanel(selectedRule, okButton, cancelButton, panelType);
475 panel =
new FilesSetRulePanel(okButton, cancelButton, panelType);
480 int option = JOptionPane.OK_OPTION;
482 option = JOptionPane.showOptionDialog(
this, panel, NbBundle.getMessage(
FilesSetPanel.class, ruleDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null,
new Object[]{okButton, cancelButton}, okButton);
484 }
while (option == JOptionPane.OK_OPTION && !panel.isValidRuleDefinition());
486 if (option == JOptionPane.OK_OPTION) {
490 FilesSet selectedSet = this.setsList.getSelectedValue();
495 if (selectedRule != null) {
496 rules.remove(selectedRule.getUuid());
498 FilesSet.
Rule newRule =
new FilesSet.
Rule(panel.getRuleName(), panel.getFileNameCondition(), panel.getMetaTypeCondition(), panel.getPathCondition(), panel.getMimeTypeCondition(), panel.getFileSizeCondition(), panel.getDateCondition());
499 rules.put(newRule.getUuid(), newRule);
503 this.replaceFilesSet(selectedSet, selectedSet, rules);
508 EventQueue.invokeLater(() -> {
509 this.rulesList.setSelectedValue(newRule,
true);
526 if (oldSet != null) {
529 this.filesSets.remove(oldSet.
getName());
543 newSet.isStandardSet(),
544 newSet.getVersionNumber()
548 this.filesSets.put(setToAdd.
getName(), setToAdd);
553 this.filesSets.values().forEach((set) -> {
554 this.setsListModel.addElement(set);
560 this.setsList.setSelectedValue(setToAdd,
true);
568 @SuppressWarnings(
"unchecked")
570 private
void initComponents() {
572 fileNameButtonGroup =
new javax.swing.ButtonGroup();
573 typeButtonGroup =
new javax.swing.ButtonGroup();
574 jScrollPane1 =
new javax.swing.JScrollPane();
575 jPanel1 =
new javax.swing.JPanel();
576 setDetailsLabel =
new javax.swing.JLabel();
577 newRuleButton =
new javax.swing.JButton();
578 filesRadioButton =
new javax.swing.JRadioButton();
579 editRuleButton =
new javax.swing.JButton();
580 rulesListLabel =
new javax.swing.JLabel();
581 rulesListScrollPane =
new javax.swing.JScrollPane();
582 rulesList =
new javax.swing.JList<>();
583 setDescScrollPanel =
new javax.swing.JScrollPane();
584 setDescriptionTextArea =
new javax.swing.JTextArea();
585 editSetButton =
new javax.swing.JButton();
586 setsListScrollPane =
new javax.swing.JScrollPane();
587 setsList =
new javax.swing.JList<>();
588 fileNameExtensionRadioButton =
new javax.swing.JRadioButton();
589 nameLabel =
new javax.swing.JLabel();
590 fileNameTextField =
new javax.swing.JTextField();
591 descriptionLabel =
new javax.swing.JLabel();
592 fileNameRadioButton =
new javax.swing.JRadioButton();
593 rulePathConditionTextField =
new javax.swing.JTextField();
594 ignoreKnownFilesCheckbox =
new javax.swing.JCheckBox();
595 fileNameRegexCheckbox =
new javax.swing.JCheckBox();
596 separator =
new javax.swing.JSeparator();
597 setsListLabel =
new javax.swing.JLabel();
598 allRadioButton =
new javax.swing.JRadioButton();
599 deleteSetButton =
new javax.swing.JButton();
600 deleteRuleButton =
new javax.swing.JButton();
601 newSetButton =
new javax.swing.JButton();
602 fileTypeLabel =
new javax.swing.JLabel();
603 dirsRadioButton =
new javax.swing.JRadioButton();
604 ruleLabel =
new javax.swing.JLabel();
605 pathLabel =
new javax.swing.JLabel();
606 rulePathConditionRegexCheckBox =
new javax.swing.JCheckBox();
607 descriptionScrollPane =
new javax.swing.JScrollPane();
608 descriptionTextArea =
new javax.swing.JTextArea();
609 mimeTypeLabel =
new javax.swing.JLabel();
610 mimeTypeComboBox =
new javax.swing.JComboBox<>();
611 fileSizeLabel =
new javax.swing.JLabel();
612 equalitySignComboBox =
new javax.swing.JComboBox<String>();
613 fileSizeSpinner =
new javax.swing.JSpinner();
614 fileSizeUnitComboBox =
new javax.swing.JComboBox<String>();
615 ingoreUnallocCheckbox =
new javax.swing.JCheckBox();
616 ingestWarningLabel =
new javax.swing.JLabel();
617 copySetButton =
new javax.swing.JButton();
618 importSetButton =
new javax.swing.JButton();
619 exportSetButton =
new javax.swing.JButton();
620 modifiedDateLabel =
new javax.swing.JLabel();
621 daysIncludedTextField =
new javax.swing.JTextField();
622 daysIncludedLabel =
new javax.swing.JLabel();
624 org.openide.awt.Mnemonics.setLocalizedText(setDetailsLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.jLabel6.text"));
626 newRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
627 org.openide.awt.Mnemonics.setLocalizedText(newRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.newRuleButton.text"));
628 newRuleButton.addActionListener(
new java.awt.event.ActionListener() {
629 public void actionPerformed(java.awt.event.ActionEvent evt) {
630 newRuleButtonActionPerformed(evt);
634 typeButtonGroup.add(filesRadioButton);
635 filesRadioButton.setSelected(
true);
636 org.openide.awt.Mnemonics.setLocalizedText(filesRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.filesRadioButton.text"));
637 filesRadioButton.setEnabled(
false);
639 editRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/edit16.png")));
640 org.openide.awt.Mnemonics.setLocalizedText(editRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.editRuleButton.text"));
641 editRuleButton.setEnabled(
false);
642 editRuleButton.addActionListener(
new java.awt.event.ActionListener() {
643 public void actionPerformed(java.awt.event.ActionEvent evt) {
644 editRuleButtonActionPerformed(evt);
648 org.openide.awt.Mnemonics.setLocalizedText(rulesListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulesListLabel.text"));
650 rulesList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
651 rulesListScrollPane.setViewportView(rulesList);
654 setDescScrollPanel.setMinimumSize(
new java.awt.Dimension(10, 22));
655 setDescScrollPanel.setPreferredSize(
new java.awt.Dimension(14, 40));
657 setDescriptionTextArea.setEditable(
false);
658 setDescriptionTextArea.setBackground(
new java.awt.Color(240, 240, 240));
659 setDescriptionTextArea.setColumns(20);
660 setDescriptionTextArea.setLineWrap(
true);
661 setDescriptionTextArea.setRows(6);
662 setDescriptionTextArea.setMinimumSize(
new java.awt.Dimension(10, 22));
663 setDescriptionTextArea.setOpaque(
false);
664 setDescScrollPanel.setViewportView(setDescriptionTextArea);
666 editSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/edit16.png")));
667 org.openide.awt.Mnemonics.setLocalizedText(editSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.editSetButton.text"));
668 editSetButton.setEnabled(
false);
669 editSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
670 editSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
671 editSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
672 editSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
673 editSetButton.addActionListener(
new java.awt.event.ActionListener() {
674 public void actionPerformed(java.awt.event.ActionEvent evt) {
675 editSetButtonActionPerformed(evt);
679 setsList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
680 setsListScrollPane.setViewportView(setsList);
683 fileNameButtonGroup.add(fileNameExtensionRadioButton);
684 org.openide.awt.Mnemonics.setLocalizedText(fileNameExtensionRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameExtensionRadioButton.text"));
685 fileNameExtensionRadioButton.setEnabled(
false);
687 org.openide.awt.Mnemonics.setLocalizedText(nameLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.nameLabel.text"));
689 fileNameTextField.setEditable(
false);
690 fileNameTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameTextField.text"));
692 org.openide.awt.Mnemonics.setLocalizedText(descriptionLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.descriptionLabel.text"));
694 fileNameButtonGroup.add(fileNameRadioButton);
695 org.openide.awt.Mnemonics.setLocalizedText(fileNameRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameRadioButton.text"));
696 fileNameRadioButton.setEnabled(
false);
698 rulePathConditionTextField.setEditable(
false);
699 rulePathConditionTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulePathConditionTextField.text"));
701 org.openide.awt.Mnemonics.setLocalizedText(ignoreKnownFilesCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ignoreKnownFilesCheckbox.text"));
702 ignoreKnownFilesCheckbox.setEnabled(
false);
704 org.openide.awt.Mnemonics.setLocalizedText(fileNameRegexCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameRegexCheckbox.text"));
705 fileNameRegexCheckbox.setEnabled(
false);
706 fileNameRegexCheckbox.addActionListener(
new java.awt.event.ActionListener() {
707 public void actionPerformed(java.awt.event.ActionEvent evt) {
708 fileNameRegexCheckboxActionPerformed(evt);
712 separator.setOrientation(javax.swing.SwingConstants.VERTICAL);
714 org.openide.awt.Mnemonics.setLocalizedText(setsListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.setsListLabel.text"));
716 typeButtonGroup.add(allRadioButton);
717 org.openide.awt.Mnemonics.setLocalizedText(allRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.allRadioButton.text"));
718 allRadioButton.setEnabled(
false);
720 deleteSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
721 org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.deleteSetButton.text"));
722 deleteSetButton.setEnabled(
false);
723 deleteSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
724 deleteSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
725 deleteSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
726 deleteSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
727 deleteSetButton.addActionListener(
new java.awt.event.ActionListener() {
728 public void actionPerformed(java.awt.event.ActionEvent evt) {
729 deleteSetButtonActionPerformed(evt);
733 deleteRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
734 org.openide.awt.Mnemonics.setLocalizedText(deleteRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.deleteRuleButton.text"));
735 deleteRuleButton.setEnabled(
false);
736 deleteRuleButton.addActionListener(
new java.awt.event.ActionListener() {
737 public void actionPerformed(java.awt.event.ActionEvent evt) {
738 deleteRuleButtonActionPerformed(evt);
742 newSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
743 org.openide.awt.Mnemonics.setLocalizedText(newSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.newSetButton.text"));
744 newSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
745 newSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
746 newSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
747 newSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
748 newSetButton.addActionListener(
new java.awt.event.ActionListener() {
749 public void actionPerformed(java.awt.event.ActionEvent evt) {
750 newSetButtonActionPerformed(evt);
754 org.openide.awt.Mnemonics.setLocalizedText(fileTypeLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileTypeLabel.text"));
756 typeButtonGroup.add(dirsRadioButton);
757 org.openide.awt.Mnemonics.setLocalizedText(dirsRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.dirsRadioButton.text"));
758 dirsRadioButton.setEnabled(
false);
760 org.openide.awt.Mnemonics.setLocalizedText(ruleLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ruleLabel.text"));
762 org.openide.awt.Mnemonics.setLocalizedText(pathLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.pathLabel.text"));
764 org.openide.awt.Mnemonics.setLocalizedText(rulePathConditionRegexCheckBox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulePathConditionRegexCheckBox.text"));
765 rulePathConditionRegexCheckBox.setEnabled(
false);
767 descriptionTextArea.setEditable(
false);
768 descriptionTextArea.setBackground(
new java.awt.Color(240, 240, 240));
769 descriptionTextArea.setColumns(20);
770 descriptionTextArea.setLineWrap(
true);
771 descriptionTextArea.setRows(3);
772 descriptionTextArea.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.jTextArea1.text"));
773 descriptionTextArea.setWrapStyleWord(
true);
774 descriptionTextArea.setOpaque(
false);
775 descriptionScrollPane.setViewportView(descriptionTextArea);
777 org.openide.awt.Mnemonics.setLocalizedText(mimeTypeLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.mimeTypeLabel.text"));
779 mimeTypeComboBox.setBackground(
new java.awt.Color(240, 240, 240));
780 mimeTypeComboBox.setEditable(
true);
781 mimeTypeComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] {
""}));
782 mimeTypeComboBox.setEnabled(
false);
783 mimeTypeComboBox.setMinimumSize(
new java.awt.Dimension(0, 20));
784 mimeTypeComboBox.setPreferredSize(
new java.awt.Dimension(12, 20));
786 org.openide.awt.Mnemonics.setLocalizedText(fileSizeLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileSizeLabel.text"));
788 equalitySignComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] {
"=",
">",
"≥",
"<",
"≤" }));
789 equalitySignComboBox.setEnabled(
false);
791 fileSizeSpinner.setEnabled(
false);
792 fileSizeSpinner.setMinimumSize(
new java.awt.Dimension(2, 20));
794 fileSizeUnitComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] { Bundle.FilesSetDefsPanel_bytes(), Bundle.FilesSetDefsPanel_kiloBytes(), Bundle.FilesSetDefsPanel_megaBytes(), Bundle.FilesSetDefsPanel_gigaBytes() }));
795 fileSizeUnitComboBox.setEnabled(
false);
797 org.openide.awt.Mnemonics.setLocalizedText(ingoreUnallocCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingoreUnallocCheckbox.text"));
798 ingoreUnallocCheckbox.setToolTipText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingoreUnallocCheckbox.toolTipText"));
799 ingoreUnallocCheckbox.setEnabled(
false);
801 ingestWarningLabel.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png")));
802 org.openide.awt.Mnemonics.setLocalizedText(ingestWarningLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingestWarningLabel.text"));
804 copySetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/new16.png")));
805 org.openide.awt.Mnemonics.setLocalizedText(copySetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.copySetButton.text"));
806 copySetButton.setEnabled(
false);
807 copySetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
808 copySetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
809 copySetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
810 copySetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
811 copySetButton.addActionListener(
new java.awt.event.ActionListener() {
812 public void actionPerformed(java.awt.event.ActionEvent evt) {
813 copySetButtonActionPerformed(evt);
817 importSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/import16.png")));
818 org.openide.awt.Mnemonics.setLocalizedText(importSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.importSetButton.text"));
819 importSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
820 importSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
821 importSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
822 importSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
823 importSetButton.addActionListener(
new java.awt.event.ActionListener() {
824 public void actionPerformed(java.awt.event.ActionEvent evt) {
825 importSetButtonActionPerformed(evt);
829 exportSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/export16.png")));
830 org.openide.awt.Mnemonics.setLocalizedText(exportSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.exportSetButton.text"));
831 exportSetButton.setEnabled(
false);
832 exportSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
833 exportSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
834 exportSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
835 exportSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
836 exportSetButton.addActionListener(
new java.awt.event.ActionListener() {
837 public void actionPerformed(java.awt.event.ActionEvent evt) {
838 exportSetButtonActionPerformed(evt);
842 org.openide.awt.Mnemonics.setLocalizedText(modifiedDateLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.modifiedDateLabel.text"));
844 daysIncludedTextField.setEditable(
false);
845 daysIncludedTextField.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
846 daysIncludedTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.daysIncludedTextField.text"));
847 daysIncludedTextField.setMinimumSize(
new java.awt.Dimension(60, 20));
848 daysIncludedTextField.setPreferredSize(
new java.awt.Dimension(60, 20));
850 org.openide.awt.Mnemonics.setLocalizedText(daysIncludedLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.daysIncludedLabel.text"));
851 daysIncludedLabel.setEnabled(
false);
853 javax.swing.GroupLayout jPanel1Layout =
new javax.swing.GroupLayout(jPanel1);
854 jPanel1.setLayout(jPanel1Layout);
855 jPanel1Layout.setHorizontalGroup(
856 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
857 .addGroup(jPanel1Layout.createSequentialGroup()
859 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
860 .addGroup(jPanel1Layout.createSequentialGroup()
861 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
false)
862 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
863 .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
864 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
865 .addComponent(importSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
866 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
867 .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
868 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
869 .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
870 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
871 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
872 .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
873 .addComponent(deleteSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
874 .addComponent(setsListScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
875 .addComponent(descriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
876 .addComponent(setsListLabel))
877 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
878 .addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
879 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
880 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
881 .addGroup(jPanel1Layout.createSequentialGroup()
882 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
883 .addComponent(rulesListScrollPane, javax.swing.GroupLayout.Alignment.TRAILING)
884 .addComponent(setDescScrollPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
885 .addGroup(jPanel1Layout.createSequentialGroup()
887 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
888 .addComponent(mimeTypeLabel)
889 .addComponent(fileSizeLabel)
890 .addComponent(fileTypeLabel)
891 .addComponent(pathLabel)
892 .addComponent(modifiedDateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
893 .addComponent(nameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
894 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
895 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
896 .addComponent(rulePathConditionTextField)
897 .addComponent(fileNameTextField, javax.swing.GroupLayout.Alignment.TRAILING)
898 .addComponent(mimeTypeComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
899 .addGroup(jPanel1Layout.createSequentialGroup()
900 .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
901 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
902 .addComponent(fileSizeSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
903 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
904 .addComponent(fileSizeUnitComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
905 .addGroup(jPanel1Layout.createSequentialGroup()
906 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
907 .addComponent(rulePathConditionRegexCheckBox)
908 .addGroup(jPanel1Layout.createSequentialGroup()
909 .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
910 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
911 .addComponent(daysIncludedLabel))
912 .addGroup(jPanel1Layout.createSequentialGroup()
913 .addComponent(filesRadioButton)
914 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
915 .addComponent(dirsRadioButton)
916 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
917 .addComponent(allRadioButton))
918 .addGroup(jPanel1Layout.createSequentialGroup()
919 .addComponent(fileNameRadioButton)
920 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
921 .addComponent(fileNameExtensionRadioButton)
922 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
923 .addComponent(fileNameRegexCheckbox)))
924 .addGap(0, 0, Short.MAX_VALUE)))))
926 .addGroup(jPanel1Layout.createSequentialGroup()
927 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
928 .addComponent(rulesListLabel)
929 .addGroup(jPanel1Layout.createSequentialGroup()
930 .addComponent(ignoreKnownFilesCheckbox)
931 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
932 .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
933 .addGroup(jPanel1Layout.createSequentialGroup()
934 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
935 .addComponent(descriptionLabel)
936 .addComponent(setDetailsLabel))
937 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
938 .addComponent(ingestWarningLabel))
939 .addComponent(ruleLabel)
940 .addGroup(jPanel1Layout.createSequentialGroup()
941 .addComponent(newRuleButton)
943 .addComponent(editRuleButton)
945 .addComponent(deleteRuleButton)))
946 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
949 jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {copySetButton, deleteSetButton, editSetButton, exportSetButton, importSetButton, newSetButton});
951 jPanel1Layout.setVerticalGroup(
952 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
953 .addGroup(jPanel1Layout.createSequentialGroup()
955 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
956 .addComponent(separator)
957 .addGroup(jPanel1Layout.createSequentialGroup()
958 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
959 .addGroup(jPanel1Layout.createSequentialGroup()
960 .addComponent(setDetailsLabel)
961 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
962 .addComponent(descriptionLabel)
964 .addComponent(ingestWarningLabel, javax.swing.GroupLayout.Alignment.TRAILING))
965 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
966 .addComponent(setDescScrollPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
967 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
968 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
969 .addComponent(ignoreKnownFilesCheckbox)
970 .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
971 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
972 .addComponent(rulesListLabel)
973 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
974 .addComponent(rulesListScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE)
975 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
976 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
977 .addComponent(newRuleButton)
978 .addComponent(editRuleButton)
979 .addComponent(deleteRuleButton))
980 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
981 .addComponent(ruleLabel)
982 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
983 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
984 .addComponent(fileTypeLabel)
985 .addComponent(filesRadioButton)
986 .addComponent(dirsRadioButton)
987 .addComponent(allRadioButton))
988 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
989 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
990 .addComponent(nameLabel)
991 .addComponent(fileNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
992 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
993 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
994 .addComponent(fileNameRadioButton)
995 .addComponent(fileNameExtensionRadioButton)
996 .addComponent(fileNameRegexCheckbox))
997 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
998 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
999 .addComponent(pathLabel)
1000 .addComponent(rulePathConditionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
1001 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1002 .addComponent(rulePathConditionRegexCheckBox)
1003 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1004 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1005 .addComponent(mimeTypeLabel)
1006 .addComponent(mimeTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1007 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1008 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1009 .addComponent(fileSizeLabel)
1010 .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1011 .addComponent(fileSizeSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1012 .addComponent(fileSizeUnitComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1013 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1014 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1015 .addComponent(modifiedDateLabel)
1016 .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1017 .addComponent(daysIncludedLabel))
1019 .addGroup(jPanel1Layout.createSequentialGroup()
1020 .addComponent(descriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1021 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1022 .addComponent(setsListLabel)
1023 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1024 .addComponent(setsListScrollPane)
1025 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1026 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1027 .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1028 .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1029 .addComponent(deleteSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1030 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1031 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1032 .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1033 .addComponent(importSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1034 .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1038 jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL,
new java.awt.Component[] {copySetButton, deleteRuleButton, deleteSetButton, editRuleButton, editSetButton, exportSetButton, importSetButton, newRuleButton, newSetButton});
1040 jScrollPane1.setViewportView(jPanel1);
1042 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
1043 this.setLayout(layout);
1044 layout.setHorizontalGroup(
1045 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1046 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE)
1048 layout.setVerticalGroup(
1049 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1050 .addComponent(jScrollPane1)
1055 this.doFileSetsDialog(null,
true);
1056 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1064 FilesSet oldSet = this.setsList.getSelectedValue();
1066 FilesSet.
Rule selectedRule = this.rulesList.getSelectedValue();
1067 rules.remove(selectedRule.getUuid());
1068 this.replaceFilesSet(oldSet, oldSet, rules);
1069 if (!this.rulesListModel.isEmpty()) {
1070 this.rulesList.setSelectedIndex(0);
1072 this.resetRuleComponents();
1074 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1078 FilesSet selectedSet = this.setsList.getSelectedValue();
1081 if (profile.getFileIngestFilter().equals(selectedSet.
getName())) {
1083 "FilesSetDefsPanel.ingest.fileFilterInUseError",
1084 selectedSet.
getName(), profile.toString()));
1090 this.filesSets.remove(selectedSet.
getName());
1091 this.setsListModel.removeElement(selectedSet);
1094 if (!this.filesSets.isEmpty()) {
1095 this.setsList.setSelectedIndex(0);
1097 this.resetComponents();
1099 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1103 this.doFileSetsDialog(this.setsList.getSelectedValue(),
false);
1104 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1108 this.doFilesSetRuleDialog(this.rulesList.getSelectedValue());
1109 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1113 this.doFilesSetRuleDialog(null);
1114 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1118 this.doFileSetsDialog(this.setsList.getSelectedValue(),
true);
1119 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1122 @NbBundle.Messages({
1123 "FilesSetDefsPanel.interesting.failImportMsg=Interesting files set not imported",
1124 "FilesSetDefsPanel.interesting.fileExtensionFilterLbl=Autopsy Interesting File Set File (xml)",
1125 "FilesSetDefsPanel.interesting.importButtonAction.featureName=Interesting Files Set Import",
1126 "FilesSetDefsPanel.importSetButtonActionPerformed.noFilesSelected=No files sets were selected.",
1127 "FilesSetDefsPanel.importSetButtonActionPerformed.noFiles=No files sets were found in the selected files.",
1129 "# {1} - errorMessage",
1130 "FilesSetDefsPanel.importSetButtonActionPerformed.importError=The rules file \"{0}\" could not be read:\n{1}.",})
1133 FilesSet selectedSet = this.setsList.getSelectedValue();
1134 JFileChooser chooser =
new JFileChooser();
1135 final String EXTENSION =
"xml";
1136 FileNameExtensionFilter autopsyFilter =
new FileNameExtensionFilter(
1137 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.fileExtensionFilterLbl"), EXTENSION);
1138 chooser.addChoosableFileFilter(autopsyFilter);
1139 chooser.setAcceptAllFileFilterUsed(
false);
1140 chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
1141 int returnVal = chooser.showOpenDialog(
this);
1142 if (returnVal == JFileChooser.APPROVE_OPTION) {
1143 File selFile = chooser.getSelectedFile();
1144 if (selFile == null) {
1145 JOptionPane.showMessageDialog(
this,
1146 Bundle.FilesSetDefsPanel_importSetButtonActionPerformed_noFilesSelected(),
1147 Bundle.FilesSetDefsPanel_interesting_importButtonAction_featureName(),
1148 JOptionPane.WARNING_MESSAGE);
1149 logger.warning(
"Selected file was null, when trying to import interesting files set definitions");
1152 Collection<FilesSet> importedSets;
1154 importedSets = InterestingItemsFilesSetSettings.readDefinitionsXML(selFile).values();
1155 if (importedSets.isEmpty()) {
1156 JOptionPane.showMessageDialog(
this,
1157 Bundle.FilesSetDefsPanel_importSetButtonActionPerformed_noFiles(),
1158 Bundle.FilesSetDefsPanel_interesting_importButtonAction_featureName(),
1159 JOptionPane.WARNING_MESSAGE);
1160 logger.log(Level.WARNING,
"No Interesting files set definitions were read from the selected file");
1164 JOptionPane.showMessageDialog(
this,
1165 Bundle.FilesSetDefsPanel_importSetButtonActionPerformed_importError(selFile.getName(), ex.getMessage()),
1166 Bundle.FilesSetDefsPanel_interesting_importButtonAction_featureName(),
1167 JOptionPane.WARNING_MESSAGE);
1168 logger.log(Level.WARNING,
"No Interesting files set definitions were read from the selected file, exception", ex);
1172 importedSets = importedSets
1175 .collect(Collectors.toList());
1177 FilesSet newSelected = determineFilesToImport(importedSets);
1181 this.filesSets.values().forEach((set) -> {
1182 this.setsListModel.addElement(set);
1187 this.setsList.setSelectedValue(newSelected == null ? selectedSet : newSelected,
true);
1189 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1205 for (
FilesSet set : importedSets) {
1206 Pair<FilesSet, Integer> conflictResult = handleConflict(set,
true);
1207 int choice = conflictResult.getRight();
1208 FilesSet resultingFilesSet = conflictResult.getLeft();
1210 if (choice == JOptionPane.OK_OPTION) {
1211 selectedSet = resultingFilesSet;
1212 this.filesSets.put(resultingFilesSet.
getName(), resultingFilesSet);
1213 }
else if (choice == JOptionPane.CANCEL_OPTION) {
1236 if (conflict == null) {
1237 return Pair.of(set, JOptionPane.OK_OPTION);
1241 if (conflict.isStandardSet()) {
1242 return onImportStandardSetConflict(set);
1244 return onImportConflict(set);
1247 if (conflict.isStandardSet()) {
1248 return onNewEditSetStandardSetConflict(set);
1250 return onNewEditSetConflict(set);
1267 "FilesSetDefsPanel.yesOwMsg=Yes, overwrite",
1268 "FilesSetDefsPanel.noSkipMsg=No, skip",
1269 "FilesSetDefsPanel.cancelImportMsg=Cancel import",
1270 "# {0} - FilesSet name",
1271 "FilesSetDefsPanel.interesting.overwriteSetPrompt=Interesting files set \"{0}\" already exists locally, overwrite?",
1272 "FilesSetDefsPanel.interesting.importOwConflict=Import Interesting files set conflict",})
1275 Object[] options = {
1276 Bundle.FilesSetDefsPanel_yesOwMsg(),
1277 Bundle.FilesSetDefsPanel_noSkipMsg(),
1278 Bundle.FilesSetDefsPanel_cancelImportMsg()
1280 int conflictChoice = JOptionPane.showOptionDialog(
this,
1281 Bundle.FilesSetDefsPanel_interesting_overwriteSetPrompt(set.
getName()),
1282 Bundle.FilesSetDefsPanel_interesting_importOwConflict(),
1283 JOptionPane.YES_NO_CANCEL_OPTION,
1284 JOptionPane.QUESTION_MESSAGE,
1289 if (conflictChoice == JOptionPane.OK_OPTION) {
1291 return Pair.of(set, conflictChoice);
1294 return Pair.of(null, conflictChoice);
1308 "FilesSetDefsPanel.yesStandardFileConflictCreate=Yes, create",
1309 "# {0} - FilesSet name",
1310 "# {1} - New FilesSet name",
1311 "FilesSetDefsPanel.interesting.standardFileConflict=A standard interesting file set already exists with the name \"{0}.\" Would you like to rename your set to \"{1}?\"",})
1315 Object[] options = {
1316 Bundle.FilesSetDefsPanel_yesStandardFileConflictCreate(),
1317 Bundle.FilesSetDefsPanel_noSkipMsg(),
1318 Bundle.FilesSetDefsPanel_cancelImportMsg()
1321 String setName = set.
getName();
1322 String customSetName = Bundle.StandardInterestingFileSetsLoader_customSuffixed(set.
getName());
1324 int conflictChoice = JOptionPane.showOptionDialog(
this,
1325 Bundle.FilesSetDefsPanel_interesting_standardFileConflict(setName, customSetName),
1326 Bundle.FilesSetDefsPanel_interesting_importOwConflict(),
1327 JOptionPane.YES_NO_CANCEL_OPTION,
1328 JOptionPane.QUESTION_MESSAGE,
1334 if (conflictChoice == JOptionPane.OK_OPTION) {
1338 return Pair.of(null, conflictChoice);
1352 "FilesSetDefsPanel.cancelNewSetMsg=Cancel",
1353 "FilesSetDefsPanel.interesting.newOwConflict=Interesting files set conflict",})
1356 Object[] options = {
1357 Bundle.FilesSetDefsPanel_yesOwMsg(),
1358 Bundle.FilesSetDefsPanel_cancelNewSetMsg()
1360 int conflictChoice = JOptionPane.showOptionDialog(
this,
1361 Bundle.FilesSetDefsPanel_interesting_overwriteSetPrompt(set.
getName()),
1362 Bundle.FilesSetDefsPanel_interesting_newOwConflict(),
1363 JOptionPane.OK_CANCEL_OPTION,
1364 JOptionPane.QUESTION_MESSAGE,
1369 if (conflictChoice == JOptionPane.OK_OPTION) {
1371 return Pair.of(set, conflictChoice);
1374 return Pair.of(null, conflictChoice);
1390 Object[] options = {
1391 Bundle.FilesSetDefsPanel_yesStandardFileConflictCreate(),
1392 Bundle.FilesSetDefsPanel_cancelNewSetMsg()
1395 String setName = set.
getName();
1396 String customSetName = Bundle.StandardInterestingFileSetsLoader_customSuffixed(set.
getName());
1398 int conflictChoice = JOptionPane.showOptionDialog(
this,
1399 Bundle.FilesSetDefsPanel_interesting_standardFileConflict(setName, customSetName),
1400 Bundle.FilesSetDefsPanel_interesting_newOwConflict(),
1401 JOptionPane.OK_CANCEL_OPTION,
1402 JOptionPane.QUESTION_MESSAGE,
1408 if (conflictChoice == JOptionPane.OK_OPTION) {
1412 return Pair.of(null, conflictChoice);
1415 @NbBundle.Messages({
"FilesSetDefsPanel.interesting.exportButtonAction.featureName=Interesting Files Set Export",
1416 "# {0} - file name",
1417 "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt=File {0} exists, overwrite?",
1418 "FilesSetDefsPanel.interesting.ExportedMsg=Interesting files set exported",
1419 "FilesSetDefsPanel.interesting.failExportMsg=Export of interesting files set failed"})
1423 JFileChooser chooser =
new JFileChooser();
1424 final String EXTENSION =
"xml";
1425 FileNameExtensionFilter autopsyFilter =
new FileNameExtensionFilter(
1426 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.fileExtensionFilterLbl"), EXTENSION);
1427 chooser.addChoosableFileFilter(autopsyFilter);
1428 chooser.setSelectedFile(
new File(this.setsList.getSelectedValue().getName()));
1429 chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
1430 int returnVal = chooser.showSaveDialog(
this);
1431 if (returnVal == JFileChooser.APPROVE_OPTION) {
1432 final String FEATURE_NAME = NbBundle.getMessage(this.getClass(),
1433 "FilesSetDefsPanel.interesting.exportButtonAction.featureName");
1434 File selFile = chooser.getSelectedFile();
1435 if (selFile == null) {
1436 JOptionPane.showMessageDialog(
this,
1437 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.failExportMsg"),
1439 JOptionPane.WARNING_MESSAGE);
1440 logger.warning(
"Selected file was null, when trying to export interesting files set definitions");
1444 String fileAbs = selFile.getAbsolutePath();
1445 if (!fileAbs.endsWith(
"." + EXTENSION)) {
1446 fileAbs = fileAbs +
"." + EXTENSION;
1447 selFile =
new File(fileAbs);
1449 if (selFile.exists()) {
1451 final String FILE_EXISTS_MESSAGE = NbBundle.getMessage(this.getClass(),
1452 "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt", selFile.getName());
1453 boolean shouldWrite = JOptionPane.showConfirmDialog(
this, FILE_EXISTS_MESSAGE, FEATURE_NAME, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION;
1458 List<FilesSet> exportSets;
1459 exportSets =
new ArrayList<>();
1461 exportSets.add(this.setsList.getSelectedValue());
1462 boolean written = InterestingItemsFilesSetSettings.exportXmlDefinitionsFile(selFile, exportSets);
1464 JOptionPane.showMessageDialog(
1465 WindowManager.getDefault().getMainWindow(),
1466 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.interesting.ExportedMsg"),
1468 JOptionPane.INFORMATION_MESSAGE);
1470 JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
1471 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.interesting.failExportMsg"),
1473 JOptionPane.WARNING_MESSAGE);
1474 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