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;
60 @SuppressWarnings(
"PMD.SingularField")
63 private static final long serialVersionUID = 1L;
65 @NbBundle.Messages({
"# {0} - filter name",
66 "# {1} - profile name",
67 "FilesSetDefsPanel.ingest.fileFilterInUseError=The selected file filter, {0}, is being used by a profile, {1}, and cannot be deleted while any profile uses it.",
68 "FilesSetDefsPanel.bytes=Bytes",
69 "FilesSetDefsPanel.kiloBytes=Kilobytes",
70 "FilesSetDefsPanel.megaBytes=Megabytes",
71 "FilesSetDefsPanel.gigaBytes=Gigabytes",
72 "FilesSetDefsPanel.loadError=Error loading interesting files sets from file.",
73 "FilesSetDefsPanel.saveError=Error saving interesting files sets to file.",
74 "FilesSetDefsPanel.interesting.copySetButton.text=Copy Set",
75 "FilesSetDefsPanel.interesting.importSetButton.text=Import Set",
76 "FilesSetDefsPanel.interesting.exportSetButton.text=Export Set"
83 private final DefaultListModel<FilesSet> setsListModel =
new DefaultListModel<>();
84 private final DefaultListModel<
FilesSet.
Rule> rulesListModel =
new DefaultListModel<>();
86 private final JButton okButton =
new JButton(
"OK");
87 private final JButton cancelButton =
new JButton(
"Cancel");
91 private boolean canBeEnabled =
true;
93 private static final String XML_EXTENSION =
"xml";
96 private static final String LAST_IMPORT_PATH_KEY =
"InterestingFilesRuleSetLastImport";
99 private static final String LAST_EXPORT_PATH_KEY =
"InterestingFilesRuleSetLastExport";
114 this.panelType = panelType;
115 this.initComponents();
118 this.setsList.setModel(setsListModel);
120 this.rulesList.setModel(rulesListModel);
122 this.ingestWarningLabel.setVisible(
false);
124 this.copySetButton.setVisible(
false);
125 this.importSetButton.setVisible(
false);
126 this.exportSetButton.setVisible(
false);
127 this.mimeTypeComboBox.setVisible(
false);
128 this.mimeTypeLabel.setVisible(
false);
129 this.filterDialogTitle =
"FilesSetPanel.filter.title";
130 this.ruleDialogTitle =
"FilesSetPanel.rule.title";
131 this.ignoreKnownFilesCheckbox.setVisible(
false);
132 this.fileTypeLabel.setVisible(
false);
133 this.filesRadioButton.setVisible(
false);
134 this.dirsRadioButton.setVisible(
false);
135 this.allRadioButton.setVisible(
false);
136 this.descriptionTextArea.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.jTextArea1.text"));
137 org.openide.awt.Mnemonics.setLocalizedText(setsListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.setsListLabel.text"));
138 org.openide.awt.Mnemonics.setLocalizedText(editSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.editSetButton.text"));
139 org.openide.awt.Mnemonics.setLocalizedText(newSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.newSetButton.text"));
140 org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.deleteSetButton.text"));
141 org.openide.awt.Mnemonics.setLocalizedText(setDetailsLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.jLabel6.text"));
143 this.filterDialogTitle =
"FilesSetPanel.interesting.title";
144 this.ruleDialogTitle =
"FilesSetPanel.interesting.title";
145 this.ingoreUnallocCheckbox.setVisible(
false);
155 this.importFileChooser =
new JFileChooser();
156 this.exportFileChooser =
new JFileChooser();
157 configureFileChooser(importFileChooser);
158 configureFileChooser(exportFileChooser);
165 FileNameExtensionFilter autopsyFilter =
new FileNameExtensionFilter(
166 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.fileExtensionFilterLbl"), XML_EXTENSION);
167 fileChooser.addChoosableFileFilter(autopsyFilter);
168 fileChooser.setAcceptAllFileFilterUsed(
false);
169 fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
172 @NbBundle.Messages({
"FilesSetDefsPanel.Interesting.Title=Global Interesting Items Settings",
173 "FilesSetDefsPanel.Ingest.Title=File Filter Settings"})
176 setName(Bundle.FilesSetDefsPanel_Ingest_Title());
178 setName(Bundle.FilesSetDefsPanel_Interesting_Title());
183 detectableMimeTypes.forEach((type) -> {
184 mimeTypeComboBox.addItem(type);
187 logger.log(Level.SEVERE,
"Unable to get detectable file types", ex);
190 this.fileSizeUnitComboBox.setSelectedIndex(1);
191 this.equalitySignComboBox.setSelectedIndex(0);
205 logger.log(Level.WARNING, Bundle.FilesSetDefsPanel_saveError(), ex);
210 FilesSet selectedFilesSet = this.setsList.getSelectedValue();
211 boolean setSelected = (selectedFilesSet != null);
212 boolean isStandardSet = (selectedFilesSet != null && selectedFilesSet.isStandardSet());
216 newRuleButton.setEnabled(canBeEnabled && setSelected && !isStandardSet);
217 copySetButton.setEnabled(canBeEnabled && setSelected);
218 newSetButton.setEnabled(canBeEnabled);
219 editRuleButton.setEnabled(canBeEnabled && ruleSelected && !isStandardSet);
220 editSetButton.setEnabled(canBeEnabled && setSelected && !isStandardSet);
221 exportSetButton.setEnabled(setSelected);
222 importSetButton.setEnabled(canBeEnabled);
223 deleteRuleButton.setEnabled(canBeEnabled && ruleSelected && !isStandardSet);
224 deleteSetButton.setEnabled(canBeEnabled && setSelected && !isStandardSet);
225 ingestWarningLabel.setVisible(!canBeEnabled);
235 this.resetComponents();
248 logger.log(Level.WARNING, Bundle.FilesSetDefsPanel_loadError(), ex);
249 this.filesSets =
new TreeMap<>();
254 this.filesSets.values().forEach((set) -> {
255 this.setsListModel.addElement(set);
258 if (!this.filesSets.isEmpty()) {
261 EventQueue.invokeLater(() -> {
271 this.setsListModel.clear();
272 this.setDescriptionTextArea.setText(
"");
273 this.ignoreKnownFilesCheckbox.setSelected(
true);
274 this.ingoreUnallocCheckbox.setSelected(
true);
275 this.resetRuleComponents();
283 this.fileNameTextField.setText(
"");
284 this.fileNameRadioButton.setSelected(
true);
285 this.fileNameRegexCheckbox.setSelected(
false);
286 this.filesRadioButton.setSelected(
true);
287 this.rulePathConditionTextField.setText(
"");
288 this.daysIncludedTextField.setText(
"");
289 this.rulePathConditionRegexCheckBox.setSelected(
false);
290 this.mimeTypeComboBox.setSelectedIndex(0);
291 this.equalitySignComboBox.setSelectedIndex(0);
292 this.fileSizeUnitComboBox.setSelectedIndex(1);
293 this.fileSizeSpinner.setValue(0);
304 if (e.getValueIsAdjusting()) {
315 if (selectedSet != null) {
323 Collections.sort(rules,
new Comparator<FilesSet.Rule>() {
326 return rule1.toString().compareTo(rule2.toString());
329 rules.forEach((rule) -> {
348 if (e.getValueIsAdjusting()) {
364 if (nameCondition != null) {
375 switch (typeCondition.getMetaType()) {
382 case FILES_AND_DIRECTORIES:
386 if (pathCondition != null) {
393 if (mimeTypeCondition != null) {
398 if (fileSizeCondition != null) {
407 if (dateCondition != null) {
414 resetRuleComponents();
434 if (selectedSet != null) {
445 int option = JOptionPane.OK_OPTION;
447 option = JOptionPane.showConfirmDialog(
this, panel, NbBundle.getMessage(
FilesSetPanel.class, filterDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
448 }
while (option == JOptionPane.OK_OPTION && !panel.isValidDefinition());
450 if (option == JOptionPane.OK_OPTION) {
452 if (selectedSet != null) {
456 rules.putAll(selectedSet.
getRules());
460 panel.getFilesSetName(),
461 panel.getFilesSetDescription(),
462 panel.getFileSetIgnoresKnownFiles(),
463 panel.getFileSetIgnoresUnallocatedSpace(),
467 Pair<FilesSet, Integer> result = handleConflict(filesSet,
false);
468 option = result.getRight();
469 FilesSet toAddOrUpdate = result.getLeft();
471 if (result.getRight() == JOptionPane.OK_OPTION) {
472 if (shouldCreateNew) {
473 this.replaceFilesSet(null, toAddOrUpdate, null);
475 this.replaceFilesSet(selectedSet, toAddOrUpdate, null);
490 FilesSetRulePanel panel;
491 if (selectedRule != null) {
493 panel =
new FilesSetRulePanel(selectedRule, okButton, cancelButton, panelType);
496 panel =
new FilesSetRulePanel(okButton, cancelButton, panelType);
501 int option = JOptionPane.OK_OPTION;
503 option = JOptionPane.showOptionDialog(
this, panel, NbBundle.getMessage(
FilesSetPanel.class, ruleDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null,
new Object[]{okButton, cancelButton}, okButton);
505 }
while (option == JOptionPane.OK_OPTION && !panel.isValidRuleDefinition());
507 if (option == JOptionPane.OK_OPTION) {
511 FilesSet selectedSet = this.setsList.getSelectedValue();
516 if (selectedRule != null) {
517 rules.remove(selectedRule.getUuid());
520 panel.getFileNameCondition(), panel.getMetaTypeCondition(),
521 panel.getPathCondition(), panel.getMimeTypeCondition(),
522 panel.getFileSizeCondition(), panel.getDateCondition(),
523 panel.isExclusive());
524 rules.put(newRule.getUuid(), newRule);
528 this.replaceFilesSet(selectedSet, selectedSet, rules);
533 EventQueue.invokeLater(() -> {
534 this.rulesList.setSelectedValue(newRule,
true);
551 if (oldSet != null) {
554 this.filesSets.remove(oldSet.
getName());
568 newSet.isStandardSet(),
569 newSet.getVersionNumber()
573 this.filesSets.put(setToAdd.
getName(), setToAdd);
578 this.filesSets.values().forEach((set) -> {
579 this.setsListModel.addElement(set);
585 this.setsList.setSelectedValue(setToAdd,
true);
593 @SuppressWarnings(
"unchecked")
595 private
void initComponents() {
597 fileNameButtonGroup =
new javax.swing.ButtonGroup();
598 typeButtonGroup =
new javax.swing.ButtonGroup();
599 jScrollPane1 =
new javax.swing.JScrollPane();
600 jPanel1 =
new javax.swing.JPanel();
601 setDetailsLabel =
new javax.swing.JLabel();
602 newRuleButton =
new javax.swing.JButton();
603 filesRadioButton =
new javax.swing.JRadioButton();
604 editRuleButton =
new javax.swing.JButton();
605 rulesListLabel =
new javax.swing.JLabel();
606 rulesListScrollPane =
new javax.swing.JScrollPane();
607 rulesList =
new javax.swing.JList<>();
608 setDescScrollPanel =
new javax.swing.JScrollPane();
609 setDescriptionTextArea =
new javax.swing.JTextArea();
610 editSetButton =
new javax.swing.JButton();
611 setsListScrollPane =
new javax.swing.JScrollPane();
612 setsList =
new javax.swing.JList<>();
613 fileNameExtensionRadioButton =
new javax.swing.JRadioButton();
614 nameLabel =
new javax.swing.JLabel();
615 fileNameTextField =
new javax.swing.JTextField();
616 descriptionLabel =
new javax.swing.JLabel();
617 fileNameRadioButton =
new javax.swing.JRadioButton();
618 rulePathConditionTextField =
new javax.swing.JTextField();
619 ignoreKnownFilesCheckbox =
new javax.swing.JCheckBox();
620 fileNameRegexCheckbox =
new javax.swing.JCheckBox();
621 separator =
new javax.swing.JSeparator();
622 setsListLabel =
new javax.swing.JLabel();
623 allRadioButton =
new javax.swing.JRadioButton();
624 deleteSetButton =
new javax.swing.JButton();
625 deleteRuleButton =
new javax.swing.JButton();
626 newSetButton =
new javax.swing.JButton();
627 fileTypeLabel =
new javax.swing.JLabel();
628 dirsRadioButton =
new javax.swing.JRadioButton();
629 ruleLabel =
new javax.swing.JLabel();
630 pathLabel =
new javax.swing.JLabel();
631 rulePathConditionRegexCheckBox =
new javax.swing.JCheckBox();
632 descriptionScrollPane =
new javax.swing.JScrollPane();
633 descriptionTextArea =
new javax.swing.JTextArea();
634 mimeTypeLabel =
new javax.swing.JLabel();
635 mimeTypeComboBox =
new javax.swing.JComboBox<>();
636 fileSizeLabel =
new javax.swing.JLabel();
637 equalitySignComboBox =
new javax.swing.JComboBox<String>();
638 fileSizeSpinner =
new javax.swing.JSpinner();
639 fileSizeUnitComboBox =
new javax.swing.JComboBox<String>();
640 ingoreUnallocCheckbox =
new javax.swing.JCheckBox();
641 ingestWarningLabel =
new javax.swing.JLabel();
642 copySetButton =
new javax.swing.JButton();
643 importSetButton =
new javax.swing.JButton();
644 exportSetButton =
new javax.swing.JButton();
645 modifiedDateLabel =
new javax.swing.JLabel();
646 daysIncludedTextField =
new javax.swing.JTextField();
647 daysIncludedLabel =
new javax.swing.JLabel();
649 org.openide.awt.Mnemonics.setLocalizedText(setDetailsLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.jLabel6.text"));
651 newRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
652 org.openide.awt.Mnemonics.setLocalizedText(newRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.newRuleButton.text"));
653 newRuleButton.addActionListener(
new java.awt.event.ActionListener() {
654 public void actionPerformed(java.awt.event.ActionEvent evt) {
655 newRuleButtonActionPerformed(evt);
659 typeButtonGroup.add(filesRadioButton);
660 filesRadioButton.setSelected(
true);
661 org.openide.awt.Mnemonics.setLocalizedText(filesRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.filesRadioButton.text"));
662 filesRadioButton.setEnabled(
false);
664 editRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/edit16.png")));
665 org.openide.awt.Mnemonics.setLocalizedText(editRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.editRuleButton.text"));
666 editRuleButton.setEnabled(
false);
667 editRuleButton.addActionListener(
new java.awt.event.ActionListener() {
668 public void actionPerformed(java.awt.event.ActionEvent evt) {
669 editRuleButtonActionPerformed(evt);
673 org.openide.awt.Mnemonics.setLocalizedText(rulesListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulesListLabel.text"));
675 rulesList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
676 rulesListScrollPane.setViewportView(rulesList);
679 setDescScrollPanel.setMinimumSize(
new java.awt.Dimension(10, 22));
680 setDescScrollPanel.setPreferredSize(
new java.awt.Dimension(14, 40));
682 setDescriptionTextArea.setEditable(
false);
683 setDescriptionTextArea.setBackground(
new java.awt.Color(240, 240, 240));
684 setDescriptionTextArea.setColumns(20);
685 setDescriptionTextArea.setLineWrap(
true);
686 setDescriptionTextArea.setRows(6);
687 setDescriptionTextArea.setMinimumSize(
new java.awt.Dimension(10, 22));
688 setDescriptionTextArea.setOpaque(
false);
689 setDescScrollPanel.setViewportView(setDescriptionTextArea);
691 editSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/edit16.png")));
692 org.openide.awt.Mnemonics.setLocalizedText(editSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.editSetButton.text"));
693 editSetButton.setEnabled(
false);
694 editSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
695 editSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
696 editSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
697 editSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
698 editSetButton.addActionListener(
new java.awt.event.ActionListener() {
699 public void actionPerformed(java.awt.event.ActionEvent evt) {
700 editSetButtonActionPerformed(evt);
704 setsList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
705 setsListScrollPane.setViewportView(setsList);
708 fileNameButtonGroup.add(fileNameExtensionRadioButton);
709 org.openide.awt.Mnemonics.setLocalizedText(fileNameExtensionRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameExtensionRadioButton.text"));
710 fileNameExtensionRadioButton.setEnabled(
false);
712 org.openide.awt.Mnemonics.setLocalizedText(nameLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.nameLabel.text"));
714 fileNameTextField.setEditable(
false);
715 fileNameTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameTextField.text"));
717 org.openide.awt.Mnemonics.setLocalizedText(descriptionLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.descriptionLabel.text"));
719 fileNameButtonGroup.add(fileNameRadioButton);
720 org.openide.awt.Mnemonics.setLocalizedText(fileNameRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameRadioButton.text"));
721 fileNameRadioButton.setEnabled(
false);
723 rulePathConditionTextField.setEditable(
false);
724 rulePathConditionTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulePathConditionTextField.text"));
726 org.openide.awt.Mnemonics.setLocalizedText(ignoreKnownFilesCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ignoreKnownFilesCheckbox.text"));
727 ignoreKnownFilesCheckbox.setEnabled(
false);
729 org.openide.awt.Mnemonics.setLocalizedText(fileNameRegexCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameRegexCheckbox.text"));
730 fileNameRegexCheckbox.setEnabled(
false);
731 fileNameRegexCheckbox.addActionListener(
new java.awt.event.ActionListener() {
732 public void actionPerformed(java.awt.event.ActionEvent evt) {
733 fileNameRegexCheckboxActionPerformed(evt);
737 separator.setOrientation(javax.swing.SwingConstants.VERTICAL);
739 org.openide.awt.Mnemonics.setLocalizedText(setsListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.setsListLabel.text"));
741 typeButtonGroup.add(allRadioButton);
742 org.openide.awt.Mnemonics.setLocalizedText(allRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.allRadioButton.text"));
743 allRadioButton.setEnabled(
false);
745 deleteSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
746 org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.deleteSetButton.text"));
747 deleteSetButton.setEnabled(
false);
748 deleteSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
749 deleteSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
750 deleteSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
751 deleteSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
752 deleteSetButton.addActionListener(
new java.awt.event.ActionListener() {
753 public void actionPerformed(java.awt.event.ActionEvent evt) {
754 deleteSetButtonActionPerformed(evt);
758 deleteRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
759 org.openide.awt.Mnemonics.setLocalizedText(deleteRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.deleteRuleButton.text"));
760 deleteRuleButton.setEnabled(
false);
761 deleteRuleButton.addActionListener(
new java.awt.event.ActionListener() {
762 public void actionPerformed(java.awt.event.ActionEvent evt) {
763 deleteRuleButtonActionPerformed(evt);
767 newSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
768 org.openide.awt.Mnemonics.setLocalizedText(newSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.newSetButton.text"));
769 newSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
770 newSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
771 newSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
772 newSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
773 newSetButton.addActionListener(
new java.awt.event.ActionListener() {
774 public void actionPerformed(java.awt.event.ActionEvent evt) {
775 newSetButtonActionPerformed(evt);
779 org.openide.awt.Mnemonics.setLocalizedText(fileTypeLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileTypeLabel.text"));
781 typeButtonGroup.add(dirsRadioButton);
782 org.openide.awt.Mnemonics.setLocalizedText(dirsRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.dirsRadioButton.text"));
783 dirsRadioButton.setEnabled(
false);
785 org.openide.awt.Mnemonics.setLocalizedText(ruleLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ruleLabel.text"));
787 org.openide.awt.Mnemonics.setLocalizedText(pathLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.pathLabel.text"));
789 org.openide.awt.Mnemonics.setLocalizedText(rulePathConditionRegexCheckBox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulePathConditionRegexCheckBox.text"));
790 rulePathConditionRegexCheckBox.setEnabled(
false);
792 descriptionTextArea.setEditable(
false);
793 descriptionTextArea.setBackground(
new java.awt.Color(240, 240, 240));
794 descriptionTextArea.setColumns(20);
795 descriptionTextArea.setLineWrap(
true);
796 descriptionTextArea.setRows(3);
797 descriptionTextArea.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.jTextArea1.text"));
798 descriptionTextArea.setWrapStyleWord(
true);
799 descriptionTextArea.setOpaque(
false);
800 descriptionScrollPane.setViewportView(descriptionTextArea);
802 org.openide.awt.Mnemonics.setLocalizedText(mimeTypeLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.mimeTypeLabel.text"));
804 mimeTypeComboBox.setBackground(
new java.awt.Color(240, 240, 240));
805 mimeTypeComboBox.setEditable(
true);
806 mimeTypeComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] {
""}));
807 mimeTypeComboBox.setEnabled(
false);
808 mimeTypeComboBox.setMinimumSize(
new java.awt.Dimension(0, 20));
809 mimeTypeComboBox.setPreferredSize(
new java.awt.Dimension(12, 20));
811 org.openide.awt.Mnemonics.setLocalizedText(fileSizeLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileSizeLabel.text"));
813 equalitySignComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] {
">",
"<" }));
814 equalitySignComboBox.setEnabled(
false);
816 fileSizeSpinner.setEnabled(
false);
817 fileSizeSpinner.setMinimumSize(
new java.awt.Dimension(2, 20));
819 fileSizeUnitComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] { Bundle.FilesSetDefsPanel_bytes(), Bundle.FilesSetDefsPanel_kiloBytes(), Bundle.FilesSetDefsPanel_megaBytes(), Bundle.FilesSetDefsPanel_gigaBytes() }));
820 fileSizeUnitComboBox.setEnabled(
false);
822 org.openide.awt.Mnemonics.setLocalizedText(ingoreUnallocCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingoreUnallocCheckbox.text"));
823 ingoreUnallocCheckbox.setToolTipText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingoreUnallocCheckbox.toolTipText"));
824 ingoreUnallocCheckbox.setEnabled(
false);
826 ingestWarningLabel.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png")));
827 org.openide.awt.Mnemonics.setLocalizedText(ingestWarningLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingestWarningLabel.text"));
829 copySetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/new16.png")));
830 org.openide.awt.Mnemonics.setLocalizedText(copySetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.copySetButton.text"));
831 copySetButton.setEnabled(
false);
832 copySetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
833 copySetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
834 copySetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
835 copySetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
836 copySetButton.addActionListener(
new java.awt.event.ActionListener() {
837 public void actionPerformed(java.awt.event.ActionEvent evt) {
838 copySetButtonActionPerformed(evt);
842 importSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/import16.png")));
843 org.openide.awt.Mnemonics.setLocalizedText(importSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.importSetButton.text"));
844 importSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
845 importSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
846 importSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
847 importSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
848 importSetButton.addActionListener(
new java.awt.event.ActionListener() {
849 public void actionPerformed(java.awt.event.ActionEvent evt) {
850 importSetButtonActionPerformed(evt);
854 exportSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/export16.png")));
855 org.openide.awt.Mnemonics.setLocalizedText(exportSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.exportSetButton.text"));
856 exportSetButton.setEnabled(
false);
857 exportSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
858 exportSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
859 exportSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
860 exportSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
861 exportSetButton.addActionListener(
new java.awt.event.ActionListener() {
862 public void actionPerformed(java.awt.event.ActionEvent evt) {
863 exportSetButtonActionPerformed(evt);
867 org.openide.awt.Mnemonics.setLocalizedText(modifiedDateLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.modifiedDateLabel.text"));
869 daysIncludedTextField.setEditable(
false);
870 daysIncludedTextField.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
871 daysIncludedTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.daysIncludedTextField.text"));
872 daysIncludedTextField.setMinimumSize(
new java.awt.Dimension(60, 20));
873 daysIncludedTextField.setPreferredSize(
new java.awt.Dimension(60, 20));
875 org.openide.awt.Mnemonics.setLocalizedText(daysIncludedLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.daysIncludedLabel.text"));
876 daysIncludedLabel.setEnabled(
false);
878 javax.swing.GroupLayout jPanel1Layout =
new javax.swing.GroupLayout(jPanel1);
879 jPanel1.setLayout(jPanel1Layout);
880 jPanel1Layout.setHorizontalGroup(
881 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
882 .addGroup(jPanel1Layout.createSequentialGroup()
884 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
885 .addGroup(jPanel1Layout.createSequentialGroup()
886 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
false)
887 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
888 .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
889 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
890 .addComponent(importSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
891 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
892 .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
893 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
894 .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
895 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
896 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
897 .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
898 .addComponent(deleteSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
899 .addComponent(setsListScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
900 .addComponent(descriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
901 .addComponent(setsListLabel))
902 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
903 .addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
904 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
905 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
906 .addGroup(jPanel1Layout.createSequentialGroup()
907 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
908 .addComponent(rulesListScrollPane, javax.swing.GroupLayout.Alignment.TRAILING)
909 .addComponent(setDescScrollPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
910 .addGroup(jPanel1Layout.createSequentialGroup()
912 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
913 .addComponent(mimeTypeLabel)
914 .addComponent(fileSizeLabel)
915 .addComponent(fileTypeLabel)
916 .addComponent(pathLabel)
917 .addComponent(modifiedDateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
918 .addComponent(nameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
919 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
920 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
921 .addComponent(rulePathConditionTextField)
922 .addComponent(fileNameTextField, javax.swing.GroupLayout.Alignment.TRAILING)
923 .addComponent(mimeTypeComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
924 .addGroup(jPanel1Layout.createSequentialGroup()
925 .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
926 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
927 .addComponent(fileSizeSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
928 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
929 .addComponent(fileSizeUnitComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
930 .addGroup(jPanel1Layout.createSequentialGroup()
931 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
932 .addComponent(rulePathConditionRegexCheckBox)
933 .addGroup(jPanel1Layout.createSequentialGroup()
934 .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
935 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
936 .addComponent(daysIncludedLabel))
937 .addGroup(jPanel1Layout.createSequentialGroup()
938 .addComponent(filesRadioButton)
939 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
940 .addComponent(dirsRadioButton)
941 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
942 .addComponent(allRadioButton))
943 .addGroup(jPanel1Layout.createSequentialGroup()
944 .addComponent(fileNameRadioButton)
945 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
946 .addComponent(fileNameExtensionRadioButton)
947 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
948 .addComponent(fileNameRegexCheckbox)))
949 .addGap(0, 0, Short.MAX_VALUE)))))
951 .addGroup(jPanel1Layout.createSequentialGroup()
952 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
953 .addComponent(rulesListLabel)
954 .addGroup(jPanel1Layout.createSequentialGroup()
955 .addComponent(ignoreKnownFilesCheckbox)
956 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
957 .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
958 .addGroup(jPanel1Layout.createSequentialGroup()
959 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
960 .addComponent(descriptionLabel)
961 .addComponent(setDetailsLabel))
962 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
963 .addComponent(ingestWarningLabel))
964 .addComponent(ruleLabel)
965 .addGroup(jPanel1Layout.createSequentialGroup()
966 .addComponent(newRuleButton)
968 .addComponent(editRuleButton)
970 .addComponent(deleteRuleButton)))
971 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
974 jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {copySetButton, deleteSetButton, editSetButton, exportSetButton, importSetButton, newSetButton});
976 jPanel1Layout.setVerticalGroup(
977 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
978 .addGroup(jPanel1Layout.createSequentialGroup()
980 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
981 .addComponent(separator)
982 .addGroup(jPanel1Layout.createSequentialGroup()
983 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
984 .addGroup(jPanel1Layout.createSequentialGroup()
985 .addComponent(setDetailsLabel)
986 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
987 .addComponent(descriptionLabel)
989 .addComponent(ingestWarningLabel, javax.swing.GroupLayout.Alignment.TRAILING))
990 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
991 .addComponent(setDescScrollPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
992 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
993 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
994 .addComponent(ignoreKnownFilesCheckbox)
995 .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
996 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
997 .addComponent(rulesListLabel)
998 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
999 .addComponent(rulesListScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE)
1000 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1001 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1002 .addComponent(newRuleButton)
1003 .addComponent(editRuleButton)
1004 .addComponent(deleteRuleButton))
1005 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1006 .addComponent(ruleLabel)
1007 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1008 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1009 .addComponent(fileTypeLabel)
1010 .addComponent(filesRadioButton)
1011 .addComponent(dirsRadioButton)
1012 .addComponent(allRadioButton))
1013 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1014 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1015 .addComponent(nameLabel)
1016 .addComponent(fileNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
1017 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1018 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1019 .addComponent(fileNameRadioButton)
1020 .addComponent(fileNameExtensionRadioButton)
1021 .addComponent(fileNameRegexCheckbox))
1022 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1023 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1024 .addComponent(pathLabel)
1025 .addComponent(rulePathConditionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
1026 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1027 .addComponent(rulePathConditionRegexCheckBox)
1028 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1029 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1030 .addComponent(mimeTypeLabel)
1031 .addComponent(mimeTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1032 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1033 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1034 .addComponent(fileSizeLabel)
1035 .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1036 .addComponent(fileSizeSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1037 .addComponent(fileSizeUnitComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1038 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1039 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1040 .addComponent(modifiedDateLabel)
1041 .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1042 .addComponent(daysIncludedLabel))
1044 .addGroup(jPanel1Layout.createSequentialGroup()
1045 .addComponent(descriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1046 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1047 .addComponent(setsListLabel)
1048 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1049 .addComponent(setsListScrollPane)
1050 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1051 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1052 .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1053 .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1054 .addComponent(deleteSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1055 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1056 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1057 .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1058 .addComponent(importSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1059 .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1063 jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL,
new java.awt.Component[] {copySetButton, deleteRuleButton, deleteSetButton, editRuleButton, editSetButton, exportSetButton, importSetButton, newRuleButton, newSetButton});
1065 jScrollPane1.setViewportView(jPanel1);
1067 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
1068 this.setLayout(layout);
1069 layout.setHorizontalGroup(
1070 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1071 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE)
1073 layout.setVerticalGroup(
1074 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1075 .addComponent(jScrollPane1)
1080 this.doFileSetsDialog(null,
true);
1081 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1089 FilesSet oldSet = this.setsList.getSelectedValue();
1091 FilesSet.
Rule selectedRule = this.rulesList.getSelectedValue();
1092 rules.remove(selectedRule.getUuid());
1093 this.replaceFilesSet(oldSet, oldSet, rules);
1094 if (!this.rulesListModel.isEmpty()) {
1095 this.rulesList.setSelectedIndex(0);
1097 this.resetRuleComponents();
1099 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1103 FilesSet selectedSet = this.setsList.getSelectedValue();
1106 if (profile.getFileIngestFilter().equals(selectedSet.
getName())) {
1108 "FilesSetDefsPanel.ingest.fileFilterInUseError",
1109 selectedSet.
getName(), profile.toString()));
1115 this.filesSets.remove(selectedSet.
getName());
1116 this.setsListModel.removeElement(selectedSet);
1119 if (!this.filesSets.isEmpty()) {
1120 this.setsList.setSelectedIndex(0);
1122 this.resetComponents();
1124 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1128 this.doFileSetsDialog(this.setsList.getSelectedValue(),
false);
1129 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1133 this.doFilesSetRuleDialog(this.rulesList.getSelectedValue());
1134 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1138 this.doFilesSetRuleDialog(null);
1139 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1143 this.doFileSetsDialog(this.setsList.getSelectedValue(),
true);
1144 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1147 @NbBundle.Messages({
1148 "FilesSetDefsPanel.interesting.failImportMsg=Interesting files set not imported",
1149 "FilesSetDefsPanel.interesting.fileExtensionFilterLbl=Autopsy Interesting File Set File (xml)",
1150 "FilesSetDefsPanel.interesting.importButtonAction.featureName=Interesting Files Set Import",
1151 "FilesSetDefsPanel.importSetButtonActionPerformed.noFilesSelected=No files sets were selected.",
1152 "FilesSetDefsPanel.importSetButtonActionPerformed.noFiles=No files sets were found in the selected files.",
1154 "# {1} - errorMessage",
1155 "FilesSetDefsPanel.importSetButtonActionPerformed.importError=The rules file \"{0}\" could not be read:\n{1}.",})
1158 FilesSet selectedSet = this.setsList.getSelectedValue();
1160 File lastFolder = getLastUsedDirectory(LAST_IMPORT_PATH_KEY);
1161 importFileChooser.setCurrentDirectory(lastFolder);
1163 int returnVal = importFileChooser.showOpenDialog(
this);
1164 if (returnVal == JFileChooser.APPROVE_OPTION) {
1165 File selFile = importFileChooser.getSelectedFile();
1166 if (selFile == null) {
1167 JOptionPane.showMessageDialog(
this,
1168 Bundle.FilesSetDefsPanel_importSetButtonActionPerformed_noFilesSelected(),
1169 Bundle.FilesSetDefsPanel_interesting_importButtonAction_featureName(),
1170 JOptionPane.WARNING_MESSAGE);
1171 logger.warning(
"Selected file was null, when trying to import interesting files set definitions");
1177 Collection<FilesSet> importedSets;
1179 importedSets = InterestingItemsFilesSetSettings.readDefinitionsXML(selFile).values();
1180 if (importedSets.isEmpty()) {
1181 JOptionPane.showMessageDialog(
this,
1182 Bundle.FilesSetDefsPanel_importSetButtonActionPerformed_noFiles(),
1183 Bundle.FilesSetDefsPanel_interesting_importButtonAction_featureName(),
1184 JOptionPane.WARNING_MESSAGE);
1185 logger.log(Level.WARNING,
"No Interesting files set definitions were read from the selected file");
1189 JOptionPane.showMessageDialog(
this,
1190 Bundle.FilesSetDefsPanel_importSetButtonActionPerformed_importError(selFile.getName(), ex.getMessage()),
1191 Bundle.FilesSetDefsPanel_interesting_importButtonAction_featureName(),
1192 JOptionPane.WARNING_MESSAGE);
1193 logger.log(Level.WARNING,
"No Interesting files set definitions were read from the selected file, exception", ex);
1197 importedSets = importedSets
1200 .collect(Collectors.toList());
1202 FilesSet newSelected = determineFilesToImport(importedSets);
1206 this.filesSets.values().forEach((set) -> {
1207 this.setsListModel.addElement(set);
1212 this.setsList.setSelectedValue(newSelected == null ? selectedSet : newSelected,
true);
1214 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1228 File lastFolder = null;
1231 File lastDirectoryFile =
new File(lastDirectory);
1233 if (lastDirectoryFile.exists()) {
1234 lastFolder = lastDirectoryFile;
1251 for (
FilesSet set : importedSets) {
1252 Pair<FilesSet, Integer> conflictResult = handleConflict(set,
true);
1253 int choice = conflictResult.getRight();
1254 FilesSet resultingFilesSet = conflictResult.getLeft();
1256 if (choice == JOptionPane.OK_OPTION) {
1257 selectedSet = resultingFilesSet;
1258 this.filesSets.put(resultingFilesSet.
getName(), resultingFilesSet);
1259 }
else if (choice == JOptionPane.CANCEL_OPTION) {
1282 if (conflict == null) {
1283 return Pair.of(set, JOptionPane.OK_OPTION);
1287 if (conflict.isStandardSet()) {
1288 return onImportStandardSetConflict(set);
1290 return onImportConflict(set);
1293 if (conflict.isStandardSet()) {
1294 return onNewEditSetStandardSetConflict(set);
1296 return onNewEditSetConflict(set);
1313 "FilesSetDefsPanel.yesOwMsg=Yes, overwrite",
1314 "FilesSetDefsPanel.noSkipMsg=No, skip",
1315 "FilesSetDefsPanel.cancelImportMsg=Cancel import",
1316 "# {0} - FilesSet name",
1317 "FilesSetDefsPanel.interesting.overwriteSetPrompt=Interesting files set \"{0}\" already exists locally, overwrite?",
1318 "FilesSetDefsPanel.interesting.importOwConflict=Import Interesting files set conflict",})
1321 Object[] options = {
1322 Bundle.FilesSetDefsPanel_yesOwMsg(),
1323 Bundle.FilesSetDefsPanel_noSkipMsg(),
1324 Bundle.FilesSetDefsPanel_cancelImportMsg()
1326 int conflictChoice = JOptionPane.showOptionDialog(
this,
1327 Bundle.FilesSetDefsPanel_interesting_overwriteSetPrompt(set.
getName()),
1328 Bundle.FilesSetDefsPanel_interesting_importOwConflict(),
1329 JOptionPane.YES_NO_CANCEL_OPTION,
1330 JOptionPane.QUESTION_MESSAGE,
1335 if (conflictChoice == JOptionPane.OK_OPTION) {
1337 return Pair.of(set, conflictChoice);
1340 return Pair.of(null, conflictChoice);
1354 "FilesSetDefsPanel.yesStandardFileConflictCreate=Yes, create",
1355 "# {0} - FilesSet name",
1356 "# {1} - New FilesSet name",
1357 "FilesSetDefsPanel.interesting.standardFileConflict=A standard interesting file set already exists with the name \"{0}.\" Would you like to rename your set to \"{1}?\"",})
1361 Object[] options = {
1362 Bundle.FilesSetDefsPanel_yesStandardFileConflictCreate(),
1363 Bundle.FilesSetDefsPanel_noSkipMsg(),
1364 Bundle.FilesSetDefsPanel_cancelImportMsg()
1367 String setName = set.
getName();
1368 String customSetName = Bundle.StandardInterestingFileSetsLoader_customSuffixed(set.
getName());
1370 int conflictChoice = JOptionPane.showOptionDialog(
this,
1371 Bundle.FilesSetDefsPanel_interesting_standardFileConflict(setName, customSetName),
1372 Bundle.FilesSetDefsPanel_interesting_importOwConflict(),
1373 JOptionPane.YES_NO_CANCEL_OPTION,
1374 JOptionPane.QUESTION_MESSAGE,
1380 if (conflictChoice == JOptionPane.OK_OPTION) {
1384 return Pair.of(null, conflictChoice);
1398 "FilesSetDefsPanel.cancelNewSetMsg=Cancel",
1399 "FilesSetDefsPanel.interesting.newOwConflict=Interesting files set conflict",})
1402 Object[] options = {
1403 Bundle.FilesSetDefsPanel_yesOwMsg(),
1404 Bundle.FilesSetDefsPanel_cancelNewSetMsg()
1406 int conflictChoice = JOptionPane.showOptionDialog(
this,
1407 Bundle.FilesSetDefsPanel_interesting_overwriteSetPrompt(set.
getName()),
1408 Bundle.FilesSetDefsPanel_interesting_newOwConflict(),
1409 JOptionPane.OK_CANCEL_OPTION,
1410 JOptionPane.QUESTION_MESSAGE,
1415 if (conflictChoice == JOptionPane.OK_OPTION) {
1417 return Pair.of(set, conflictChoice);
1420 return Pair.of(null, conflictChoice);
1436 Object[] options = {
1437 Bundle.FilesSetDefsPanel_yesStandardFileConflictCreate(),
1438 Bundle.FilesSetDefsPanel_cancelNewSetMsg()
1441 String setName = set.
getName();
1442 String customSetName = Bundle.StandardInterestingFileSetsLoader_customSuffixed(set.
getName());
1444 int conflictChoice = JOptionPane.showOptionDialog(
this,
1445 Bundle.FilesSetDefsPanel_interesting_standardFileConflict(setName, customSetName),
1446 Bundle.FilesSetDefsPanel_interesting_newOwConflict(),
1447 JOptionPane.OK_CANCEL_OPTION,
1448 JOptionPane.QUESTION_MESSAGE,
1454 if (conflictChoice == JOptionPane.OK_OPTION) {
1458 return Pair.of(null, conflictChoice);
1461 @NbBundle.Messages({
"FilesSetDefsPanel.interesting.exportButtonAction.featureName=Interesting Files Set Export",
1462 "# {0} - file name",
1463 "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt=File {0} exists, overwrite?",
1464 "FilesSetDefsPanel.interesting.ExportedMsg=Interesting files set exported",
1465 "FilesSetDefsPanel.interesting.failExportMsg=Export of interesting files set failed"})
1469 exportFileChooser.setSelectedFile(
new File(this.setsList.getSelectedValue().getName()));
1471 final File lastDirectory = getLastUsedDirectory(LAST_EXPORT_PATH_KEY);
1472 exportFileChooser.setCurrentDirectory(lastDirectory);
1474 int returnVal = exportFileChooser.showSaveDialog(
this);
1475 if (returnVal == JFileChooser.APPROVE_OPTION) {
1476 final String FEATURE_NAME = NbBundle.getMessage(this.getClass(),
1477 "FilesSetDefsPanel.interesting.exportButtonAction.featureName");
1478 File selFile = exportFileChooser.getSelectedFile();
1479 if (selFile == null) {
1480 JOptionPane.showMessageDialog(
this,
1481 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.failExportMsg"),
1483 JOptionPane.WARNING_MESSAGE);
1484 logger.warning(
"Selected file was null, when trying to export interesting files set definitions");
1491 String fileAbs = selFile.getAbsolutePath();
1492 if (!fileAbs.endsWith(
"." + XML_EXTENSION)) {
1493 fileAbs = fileAbs +
"." + XML_EXTENSION;
1494 selFile =
new File(fileAbs);
1496 if (selFile.exists()) {
1498 final String FILE_EXISTS_MESSAGE = NbBundle.getMessage(this.getClass(),
1499 "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt", selFile.getName());
1500 boolean shouldWrite = JOptionPane.showConfirmDialog(
this, FILE_EXISTS_MESSAGE, FEATURE_NAME, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION;
1505 List<FilesSet> exportSets;
1506 exportSets =
new ArrayList<>();
1508 exportSets.add(this.setsList.getSelectedValue());
1509 boolean written = InterestingItemsFilesSetSettings.exportXmlDefinitionsFile(selFile, exportSets);
1511 JOptionPane.showMessageDialog(
1512 WindowManager.getDefault().getMainWindow(),
1513 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.interesting.ExportedMsg"),
1515 JOptionPane.INFORMATION_MESSAGE);
1517 JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
1518 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.interesting.failExportMsg"),
1520 JOptionPane.WARNING_MESSAGE);
1521 logger.warning(
"Export of interesting files set failed unable to write definitions xml file");
static synchronized String getConfigSetting(String moduleName, String settingName)
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)
final JFileChooser exportFileChooser
javax.swing.JList< FilesSet > setsList
Map< String, FilesSet > getCustomFileIngestFilters()
javax.swing.JSpinner fileSizeSpinner
static synchronized boolean settingExists(String moduleName, String settingName)
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
static synchronized void setConfigSetting(String moduleName, String settingName, String settingVal)
void newRuleButtonActionPerformed(java.awt.event.ActionEvent evt)
File getLastUsedDirectory(String key)
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
void configureFileChooser(JFileChooser fileChooser)
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
static final String MAIN_SETTINGS
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()
final JFileChooser importFileChooser
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