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());
519 FilesSet.
Rule newRule =
new FilesSet.
Rule(panel.getRuleName(), panel.getFileNameCondition(), panel.getMetaTypeCondition(), panel.getPathCondition(), panel.getMimeTypeCondition(), panel.getFileSizeCondition(), panel.getDateCondition());
520 rules.put(newRule.getUuid(), newRule);
524 this.replaceFilesSet(selectedSet, selectedSet, rules);
529 EventQueue.invokeLater(() -> {
530 this.rulesList.setSelectedValue(newRule,
true);
547 if (oldSet != null) {
550 this.filesSets.remove(oldSet.
getName());
564 newSet.isStandardSet(),
565 newSet.getVersionNumber()
569 this.filesSets.put(setToAdd.
getName(), setToAdd);
574 this.filesSets.values().forEach((set) -> {
575 this.setsListModel.addElement(set);
581 this.setsList.setSelectedValue(setToAdd,
true);
589 @SuppressWarnings(
"unchecked")
591 private
void initComponents() {
593 fileNameButtonGroup =
new javax.swing.ButtonGroup();
594 typeButtonGroup =
new javax.swing.ButtonGroup();
595 jScrollPane1 =
new javax.swing.JScrollPane();
596 jPanel1 =
new javax.swing.JPanel();
597 setDetailsLabel =
new javax.swing.JLabel();
598 newRuleButton =
new javax.swing.JButton();
599 filesRadioButton =
new javax.swing.JRadioButton();
600 editRuleButton =
new javax.swing.JButton();
601 rulesListLabel =
new javax.swing.JLabel();
602 rulesListScrollPane =
new javax.swing.JScrollPane();
603 rulesList =
new javax.swing.JList<>();
604 setDescScrollPanel =
new javax.swing.JScrollPane();
605 setDescriptionTextArea =
new javax.swing.JTextArea();
606 editSetButton =
new javax.swing.JButton();
607 setsListScrollPane =
new javax.swing.JScrollPane();
608 setsList =
new javax.swing.JList<>();
609 fileNameExtensionRadioButton =
new javax.swing.JRadioButton();
610 nameLabel =
new javax.swing.JLabel();
611 fileNameTextField =
new javax.swing.JTextField();
612 descriptionLabel =
new javax.swing.JLabel();
613 fileNameRadioButton =
new javax.swing.JRadioButton();
614 rulePathConditionTextField =
new javax.swing.JTextField();
615 ignoreKnownFilesCheckbox =
new javax.swing.JCheckBox();
616 fileNameRegexCheckbox =
new javax.swing.JCheckBox();
617 separator =
new javax.swing.JSeparator();
618 setsListLabel =
new javax.swing.JLabel();
619 allRadioButton =
new javax.swing.JRadioButton();
620 deleteSetButton =
new javax.swing.JButton();
621 deleteRuleButton =
new javax.swing.JButton();
622 newSetButton =
new javax.swing.JButton();
623 fileTypeLabel =
new javax.swing.JLabel();
624 dirsRadioButton =
new javax.swing.JRadioButton();
625 ruleLabel =
new javax.swing.JLabel();
626 pathLabel =
new javax.swing.JLabel();
627 rulePathConditionRegexCheckBox =
new javax.swing.JCheckBox();
628 descriptionScrollPane =
new javax.swing.JScrollPane();
629 descriptionTextArea =
new javax.swing.JTextArea();
630 mimeTypeLabel =
new javax.swing.JLabel();
631 mimeTypeComboBox =
new javax.swing.JComboBox<>();
632 fileSizeLabel =
new javax.swing.JLabel();
633 equalitySignComboBox =
new javax.swing.JComboBox<String>();
634 fileSizeSpinner =
new javax.swing.JSpinner();
635 fileSizeUnitComboBox =
new javax.swing.JComboBox<String>();
636 ingoreUnallocCheckbox =
new javax.swing.JCheckBox();
637 ingestWarningLabel =
new javax.swing.JLabel();
638 copySetButton =
new javax.swing.JButton();
639 importSetButton =
new javax.swing.JButton();
640 exportSetButton =
new javax.swing.JButton();
641 modifiedDateLabel =
new javax.swing.JLabel();
642 daysIncludedTextField =
new javax.swing.JTextField();
643 daysIncludedLabel =
new javax.swing.JLabel();
645 org.openide.awt.Mnemonics.setLocalizedText(setDetailsLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.jLabel6.text"));
647 newRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
648 org.openide.awt.Mnemonics.setLocalizedText(newRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.newRuleButton.text"));
649 newRuleButton.addActionListener(
new java.awt.event.ActionListener() {
650 public void actionPerformed(java.awt.event.ActionEvent evt) {
651 newRuleButtonActionPerformed(evt);
655 typeButtonGroup.add(filesRadioButton);
656 filesRadioButton.setSelected(
true);
657 org.openide.awt.Mnemonics.setLocalizedText(filesRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.filesRadioButton.text"));
658 filesRadioButton.setEnabled(
false);
660 editRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/edit16.png")));
661 org.openide.awt.Mnemonics.setLocalizedText(editRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.editRuleButton.text"));
662 editRuleButton.setEnabled(
false);
663 editRuleButton.addActionListener(
new java.awt.event.ActionListener() {
664 public void actionPerformed(java.awt.event.ActionEvent evt) {
665 editRuleButtonActionPerformed(evt);
669 org.openide.awt.Mnemonics.setLocalizedText(rulesListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulesListLabel.text"));
671 rulesList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
672 rulesListScrollPane.setViewportView(rulesList);
675 setDescScrollPanel.setMinimumSize(
new java.awt.Dimension(10, 22));
676 setDescScrollPanel.setPreferredSize(
new java.awt.Dimension(14, 40));
678 setDescriptionTextArea.setEditable(
false);
679 setDescriptionTextArea.setBackground(
new java.awt.Color(240, 240, 240));
680 setDescriptionTextArea.setColumns(20);
681 setDescriptionTextArea.setLineWrap(
true);
682 setDescriptionTextArea.setRows(6);
683 setDescriptionTextArea.setMinimumSize(
new java.awt.Dimension(10, 22));
684 setDescriptionTextArea.setOpaque(
false);
685 setDescScrollPanel.setViewportView(setDescriptionTextArea);
687 editSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/edit16.png")));
688 org.openide.awt.Mnemonics.setLocalizedText(editSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.editSetButton.text"));
689 editSetButton.setEnabled(
false);
690 editSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
691 editSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
692 editSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
693 editSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
694 editSetButton.addActionListener(
new java.awt.event.ActionListener() {
695 public void actionPerformed(java.awt.event.ActionEvent evt) {
696 editSetButtonActionPerformed(evt);
700 setsList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
701 setsListScrollPane.setViewportView(setsList);
704 fileNameButtonGroup.add(fileNameExtensionRadioButton);
705 org.openide.awt.Mnemonics.setLocalizedText(fileNameExtensionRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameExtensionRadioButton.text"));
706 fileNameExtensionRadioButton.setEnabled(
false);
708 org.openide.awt.Mnemonics.setLocalizedText(nameLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.nameLabel.text"));
710 fileNameTextField.setEditable(
false);
711 fileNameTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameTextField.text"));
713 org.openide.awt.Mnemonics.setLocalizedText(descriptionLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.descriptionLabel.text"));
715 fileNameButtonGroup.add(fileNameRadioButton);
716 org.openide.awt.Mnemonics.setLocalizedText(fileNameRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameRadioButton.text"));
717 fileNameRadioButton.setEnabled(
false);
719 rulePathConditionTextField.setEditable(
false);
720 rulePathConditionTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulePathConditionTextField.text"));
722 org.openide.awt.Mnemonics.setLocalizedText(ignoreKnownFilesCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ignoreKnownFilesCheckbox.text"));
723 ignoreKnownFilesCheckbox.setEnabled(
false);
725 org.openide.awt.Mnemonics.setLocalizedText(fileNameRegexCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameRegexCheckbox.text"));
726 fileNameRegexCheckbox.setEnabled(
false);
727 fileNameRegexCheckbox.addActionListener(
new java.awt.event.ActionListener() {
728 public void actionPerformed(java.awt.event.ActionEvent evt) {
729 fileNameRegexCheckboxActionPerformed(evt);
733 separator.setOrientation(javax.swing.SwingConstants.VERTICAL);
735 org.openide.awt.Mnemonics.setLocalizedText(setsListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.setsListLabel.text"));
737 typeButtonGroup.add(allRadioButton);
738 org.openide.awt.Mnemonics.setLocalizedText(allRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.allRadioButton.text"));
739 allRadioButton.setEnabled(
false);
741 deleteSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
742 org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.deleteSetButton.text"));
743 deleteSetButton.setEnabled(
false);
744 deleteSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
745 deleteSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
746 deleteSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
747 deleteSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
748 deleteSetButton.addActionListener(
new java.awt.event.ActionListener() {
749 public void actionPerformed(java.awt.event.ActionEvent evt) {
750 deleteSetButtonActionPerformed(evt);
754 deleteRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
755 org.openide.awt.Mnemonics.setLocalizedText(deleteRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.deleteRuleButton.text"));
756 deleteRuleButton.setEnabled(
false);
757 deleteRuleButton.addActionListener(
new java.awt.event.ActionListener() {
758 public void actionPerformed(java.awt.event.ActionEvent evt) {
759 deleteRuleButtonActionPerformed(evt);
763 newSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
764 org.openide.awt.Mnemonics.setLocalizedText(newSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.newSetButton.text"));
765 newSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
766 newSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
767 newSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
768 newSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
769 newSetButton.addActionListener(
new java.awt.event.ActionListener() {
770 public void actionPerformed(java.awt.event.ActionEvent evt) {
771 newSetButtonActionPerformed(evt);
775 org.openide.awt.Mnemonics.setLocalizedText(fileTypeLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileTypeLabel.text"));
777 typeButtonGroup.add(dirsRadioButton);
778 org.openide.awt.Mnemonics.setLocalizedText(dirsRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.dirsRadioButton.text"));
779 dirsRadioButton.setEnabled(
false);
781 org.openide.awt.Mnemonics.setLocalizedText(ruleLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ruleLabel.text"));
783 org.openide.awt.Mnemonics.setLocalizedText(pathLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.pathLabel.text"));
785 org.openide.awt.Mnemonics.setLocalizedText(rulePathConditionRegexCheckBox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulePathConditionRegexCheckBox.text"));
786 rulePathConditionRegexCheckBox.setEnabled(
false);
788 descriptionTextArea.setEditable(
false);
789 descriptionTextArea.setBackground(
new java.awt.Color(240, 240, 240));
790 descriptionTextArea.setColumns(20);
791 descriptionTextArea.setLineWrap(
true);
792 descriptionTextArea.setRows(3);
793 descriptionTextArea.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.jTextArea1.text"));
794 descriptionTextArea.setWrapStyleWord(
true);
795 descriptionTextArea.setOpaque(
false);
796 descriptionScrollPane.setViewportView(descriptionTextArea);
798 org.openide.awt.Mnemonics.setLocalizedText(mimeTypeLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.mimeTypeLabel.text"));
800 mimeTypeComboBox.setBackground(
new java.awt.Color(240, 240, 240));
801 mimeTypeComboBox.setEditable(
true);
802 mimeTypeComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] {
""}));
803 mimeTypeComboBox.setEnabled(
false);
804 mimeTypeComboBox.setMinimumSize(
new java.awt.Dimension(0, 20));
805 mimeTypeComboBox.setPreferredSize(
new java.awt.Dimension(12, 20));
807 org.openide.awt.Mnemonics.setLocalizedText(fileSizeLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileSizeLabel.text"));
809 equalitySignComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] {
">",
"<" }));
810 equalitySignComboBox.setEnabled(
false);
812 fileSizeSpinner.setEnabled(
false);
813 fileSizeSpinner.setMinimumSize(
new java.awt.Dimension(2, 20));
815 fileSizeUnitComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] { Bundle.FilesSetDefsPanel_bytes(), Bundle.FilesSetDefsPanel_kiloBytes(), Bundle.FilesSetDefsPanel_megaBytes(), Bundle.FilesSetDefsPanel_gigaBytes() }));
816 fileSizeUnitComboBox.setEnabled(
false);
818 org.openide.awt.Mnemonics.setLocalizedText(ingoreUnallocCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingoreUnallocCheckbox.text"));
819 ingoreUnallocCheckbox.setToolTipText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingoreUnallocCheckbox.toolTipText"));
820 ingoreUnallocCheckbox.setEnabled(
false);
822 ingestWarningLabel.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png")));
823 org.openide.awt.Mnemonics.setLocalizedText(ingestWarningLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingestWarningLabel.text"));
825 copySetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/new16.png")));
826 org.openide.awt.Mnemonics.setLocalizedText(copySetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.copySetButton.text"));
827 copySetButton.setEnabled(
false);
828 copySetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
829 copySetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
830 copySetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
831 copySetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
832 copySetButton.addActionListener(
new java.awt.event.ActionListener() {
833 public void actionPerformed(java.awt.event.ActionEvent evt) {
834 copySetButtonActionPerformed(evt);
838 importSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/import16.png")));
839 org.openide.awt.Mnemonics.setLocalizedText(importSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.importSetButton.text"));
840 importSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
841 importSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
842 importSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
843 importSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
844 importSetButton.addActionListener(
new java.awt.event.ActionListener() {
845 public void actionPerformed(java.awt.event.ActionEvent evt) {
846 importSetButtonActionPerformed(evt);
850 exportSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/export16.png")));
851 org.openide.awt.Mnemonics.setLocalizedText(exportSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.exportSetButton.text"));
852 exportSetButton.setEnabled(
false);
853 exportSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
854 exportSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
855 exportSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
856 exportSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
857 exportSetButton.addActionListener(
new java.awt.event.ActionListener() {
858 public void actionPerformed(java.awt.event.ActionEvent evt) {
859 exportSetButtonActionPerformed(evt);
863 org.openide.awt.Mnemonics.setLocalizedText(modifiedDateLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.modifiedDateLabel.text"));
865 daysIncludedTextField.setEditable(
false);
866 daysIncludedTextField.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
867 daysIncludedTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.daysIncludedTextField.text"));
868 daysIncludedTextField.setMinimumSize(
new java.awt.Dimension(60, 20));
869 daysIncludedTextField.setPreferredSize(
new java.awt.Dimension(60, 20));
871 org.openide.awt.Mnemonics.setLocalizedText(daysIncludedLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.daysIncludedLabel.text"));
872 daysIncludedLabel.setEnabled(
false);
874 javax.swing.GroupLayout jPanel1Layout =
new javax.swing.GroupLayout(jPanel1);
875 jPanel1.setLayout(jPanel1Layout);
876 jPanel1Layout.setHorizontalGroup(
877 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
878 .addGroup(jPanel1Layout.createSequentialGroup()
880 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
881 .addGroup(jPanel1Layout.createSequentialGroup()
882 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
false)
883 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
884 .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
885 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
886 .addComponent(importSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
887 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
888 .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
889 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
890 .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
891 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
892 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
893 .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
894 .addComponent(deleteSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
895 .addComponent(setsListScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
896 .addComponent(descriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
897 .addComponent(setsListLabel))
898 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
899 .addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
900 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
901 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
902 .addGroup(jPanel1Layout.createSequentialGroup()
903 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
904 .addComponent(rulesListScrollPane, javax.swing.GroupLayout.Alignment.TRAILING)
905 .addComponent(setDescScrollPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
906 .addGroup(jPanel1Layout.createSequentialGroup()
908 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
909 .addComponent(mimeTypeLabel)
910 .addComponent(fileSizeLabel)
911 .addComponent(fileTypeLabel)
912 .addComponent(pathLabel)
913 .addComponent(modifiedDateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
914 .addComponent(nameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
915 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
916 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
917 .addComponent(rulePathConditionTextField)
918 .addComponent(fileNameTextField, javax.swing.GroupLayout.Alignment.TRAILING)
919 .addComponent(mimeTypeComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
920 .addGroup(jPanel1Layout.createSequentialGroup()
921 .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
922 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
923 .addComponent(fileSizeSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
924 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
925 .addComponent(fileSizeUnitComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
926 .addGroup(jPanel1Layout.createSequentialGroup()
927 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
928 .addComponent(rulePathConditionRegexCheckBox)
929 .addGroup(jPanel1Layout.createSequentialGroup()
930 .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
931 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
932 .addComponent(daysIncludedLabel))
933 .addGroup(jPanel1Layout.createSequentialGroup()
934 .addComponent(filesRadioButton)
935 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
936 .addComponent(dirsRadioButton)
937 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
938 .addComponent(allRadioButton))
939 .addGroup(jPanel1Layout.createSequentialGroup()
940 .addComponent(fileNameRadioButton)
941 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
942 .addComponent(fileNameExtensionRadioButton)
943 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
944 .addComponent(fileNameRegexCheckbox)))
945 .addGap(0, 0, Short.MAX_VALUE)))))
947 .addGroup(jPanel1Layout.createSequentialGroup()
948 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
949 .addComponent(rulesListLabel)
950 .addGroup(jPanel1Layout.createSequentialGroup()
951 .addComponent(ignoreKnownFilesCheckbox)
952 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
953 .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
954 .addGroup(jPanel1Layout.createSequentialGroup()
955 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
956 .addComponent(descriptionLabel)
957 .addComponent(setDetailsLabel))
958 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
959 .addComponent(ingestWarningLabel))
960 .addComponent(ruleLabel)
961 .addGroup(jPanel1Layout.createSequentialGroup()
962 .addComponent(newRuleButton)
964 .addComponent(editRuleButton)
966 .addComponent(deleteRuleButton)))
967 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
970 jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {copySetButton, deleteSetButton, editSetButton, exportSetButton, importSetButton, newSetButton});
972 jPanel1Layout.setVerticalGroup(
973 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
974 .addGroup(jPanel1Layout.createSequentialGroup()
976 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
977 .addComponent(separator)
978 .addGroup(jPanel1Layout.createSequentialGroup()
979 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
980 .addGroup(jPanel1Layout.createSequentialGroup()
981 .addComponent(setDetailsLabel)
982 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
983 .addComponent(descriptionLabel)
985 .addComponent(ingestWarningLabel, javax.swing.GroupLayout.Alignment.TRAILING))
986 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
987 .addComponent(setDescScrollPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
988 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
989 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
990 .addComponent(ignoreKnownFilesCheckbox)
991 .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
992 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
993 .addComponent(rulesListLabel)
994 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
995 .addComponent(rulesListScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE)
996 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
997 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
998 .addComponent(newRuleButton)
999 .addComponent(editRuleButton)
1000 .addComponent(deleteRuleButton))
1001 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1002 .addComponent(ruleLabel)
1003 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1004 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1005 .addComponent(fileTypeLabel)
1006 .addComponent(filesRadioButton)
1007 .addComponent(dirsRadioButton)
1008 .addComponent(allRadioButton))
1009 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1010 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1011 .addComponent(nameLabel)
1012 .addComponent(fileNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
1013 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1014 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1015 .addComponent(fileNameRadioButton)
1016 .addComponent(fileNameExtensionRadioButton)
1017 .addComponent(fileNameRegexCheckbox))
1018 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1019 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1020 .addComponent(pathLabel)
1021 .addComponent(rulePathConditionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
1022 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1023 .addComponent(rulePathConditionRegexCheckBox)
1024 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1025 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1026 .addComponent(mimeTypeLabel)
1027 .addComponent(mimeTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1028 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1029 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1030 .addComponent(fileSizeLabel)
1031 .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1032 .addComponent(fileSizeSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1033 .addComponent(fileSizeUnitComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1034 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1035 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1036 .addComponent(modifiedDateLabel)
1037 .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1038 .addComponent(daysIncludedLabel))
1040 .addGroup(jPanel1Layout.createSequentialGroup()
1041 .addComponent(descriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1042 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1043 .addComponent(setsListLabel)
1044 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1045 .addComponent(setsListScrollPane)
1046 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1047 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1048 .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1049 .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1050 .addComponent(deleteSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1051 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1052 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1053 .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1054 .addComponent(importSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1055 .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1059 jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL,
new java.awt.Component[] {copySetButton, deleteRuleButton, deleteSetButton, editRuleButton, editSetButton, exportSetButton, importSetButton, newRuleButton, newSetButton});
1061 jScrollPane1.setViewportView(jPanel1);
1063 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
1064 this.setLayout(layout);
1065 layout.setHorizontalGroup(
1066 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1067 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE)
1069 layout.setVerticalGroup(
1070 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1071 .addComponent(jScrollPane1)
1076 this.doFileSetsDialog(null,
true);
1077 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1085 FilesSet oldSet = this.setsList.getSelectedValue();
1087 FilesSet.
Rule selectedRule = this.rulesList.getSelectedValue();
1088 rules.remove(selectedRule.getUuid());
1089 this.replaceFilesSet(oldSet, oldSet, rules);
1090 if (!this.rulesListModel.isEmpty()) {
1091 this.rulesList.setSelectedIndex(0);
1093 this.resetRuleComponents();
1095 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1099 FilesSet selectedSet = this.setsList.getSelectedValue();
1102 if (profile.getFileIngestFilter().equals(selectedSet.
getName())) {
1104 "FilesSetDefsPanel.ingest.fileFilterInUseError",
1105 selectedSet.
getName(), profile.toString()));
1111 this.filesSets.remove(selectedSet.
getName());
1112 this.setsListModel.removeElement(selectedSet);
1115 if (!this.filesSets.isEmpty()) {
1116 this.setsList.setSelectedIndex(0);
1118 this.resetComponents();
1120 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1124 this.doFileSetsDialog(this.setsList.getSelectedValue(),
false);
1125 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1129 this.doFilesSetRuleDialog(this.rulesList.getSelectedValue());
1130 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1134 this.doFilesSetRuleDialog(null);
1135 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1139 this.doFileSetsDialog(this.setsList.getSelectedValue(),
true);
1140 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1143 @NbBundle.Messages({
1144 "FilesSetDefsPanel.interesting.failImportMsg=Interesting files set not imported",
1145 "FilesSetDefsPanel.interesting.fileExtensionFilterLbl=Autopsy Interesting File Set File (xml)",
1146 "FilesSetDefsPanel.interesting.importButtonAction.featureName=Interesting Files Set Import",
1147 "FilesSetDefsPanel.importSetButtonActionPerformed.noFilesSelected=No files sets were selected.",
1148 "FilesSetDefsPanel.importSetButtonActionPerformed.noFiles=No files sets were found in the selected files.",
1150 "# {1} - errorMessage",
1151 "FilesSetDefsPanel.importSetButtonActionPerformed.importError=The rules file \"{0}\" could not be read:\n{1}.",})
1154 FilesSet selectedSet = this.setsList.getSelectedValue();
1156 File lastFolder = getLastUsedDirectory(LAST_IMPORT_PATH_KEY);
1157 importFileChooser.setCurrentDirectory(lastFolder);
1159 int returnVal = importFileChooser.showOpenDialog(
this);
1160 if (returnVal == JFileChooser.APPROVE_OPTION) {
1161 File selFile = importFileChooser.getSelectedFile();
1162 if (selFile == null) {
1163 JOptionPane.showMessageDialog(
this,
1164 Bundle.FilesSetDefsPanel_importSetButtonActionPerformed_noFilesSelected(),
1165 Bundle.FilesSetDefsPanel_interesting_importButtonAction_featureName(),
1166 JOptionPane.WARNING_MESSAGE);
1167 logger.warning(
"Selected file was null, when trying to import interesting files set definitions");
1173 Collection<FilesSet> importedSets;
1175 importedSets = InterestingItemsFilesSetSettings.readDefinitionsXML(selFile).values();
1176 if (importedSets.isEmpty()) {
1177 JOptionPane.showMessageDialog(
this,
1178 Bundle.FilesSetDefsPanel_importSetButtonActionPerformed_noFiles(),
1179 Bundle.FilesSetDefsPanel_interesting_importButtonAction_featureName(),
1180 JOptionPane.WARNING_MESSAGE);
1181 logger.log(Level.WARNING,
"No Interesting files set definitions were read from the selected file");
1185 JOptionPane.showMessageDialog(
this,
1186 Bundle.FilesSetDefsPanel_importSetButtonActionPerformed_importError(selFile.getName(), ex.getMessage()),
1187 Bundle.FilesSetDefsPanel_interesting_importButtonAction_featureName(),
1188 JOptionPane.WARNING_MESSAGE);
1189 logger.log(Level.WARNING,
"No Interesting files set definitions were read from the selected file, exception", ex);
1193 importedSets = importedSets
1196 .collect(Collectors.toList());
1198 FilesSet newSelected = determineFilesToImport(importedSets);
1202 this.filesSets.values().forEach((set) -> {
1203 this.setsListModel.addElement(set);
1208 this.setsList.setSelectedValue(newSelected == null ? selectedSet : newSelected,
true);
1210 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1224 File lastFolder = null;
1227 File lastDirectoryFile =
new File(lastDirectory);
1229 if (lastDirectoryFile.exists()) {
1230 lastFolder = lastDirectoryFile;
1247 for (
FilesSet set : importedSets) {
1248 Pair<FilesSet, Integer> conflictResult = handleConflict(set,
true);
1249 int choice = conflictResult.getRight();
1250 FilesSet resultingFilesSet = conflictResult.getLeft();
1252 if (choice == JOptionPane.OK_OPTION) {
1253 selectedSet = resultingFilesSet;
1254 this.filesSets.put(resultingFilesSet.
getName(), resultingFilesSet);
1255 }
else if (choice == JOptionPane.CANCEL_OPTION) {
1278 if (conflict == null) {
1279 return Pair.of(set, JOptionPane.OK_OPTION);
1283 if (conflict.isStandardSet()) {
1284 return onImportStandardSetConflict(set);
1286 return onImportConflict(set);
1289 if (conflict.isStandardSet()) {
1290 return onNewEditSetStandardSetConflict(set);
1292 return onNewEditSetConflict(set);
1309 "FilesSetDefsPanel.yesOwMsg=Yes, overwrite",
1310 "FilesSetDefsPanel.noSkipMsg=No, skip",
1311 "FilesSetDefsPanel.cancelImportMsg=Cancel import",
1312 "# {0} - FilesSet name",
1313 "FilesSetDefsPanel.interesting.overwriteSetPrompt=Interesting files set \"{0}\" already exists locally, overwrite?",
1314 "FilesSetDefsPanel.interesting.importOwConflict=Import Interesting files set conflict",})
1317 Object[] options = {
1318 Bundle.FilesSetDefsPanel_yesOwMsg(),
1319 Bundle.FilesSetDefsPanel_noSkipMsg(),
1320 Bundle.FilesSetDefsPanel_cancelImportMsg()
1322 int conflictChoice = JOptionPane.showOptionDialog(
this,
1323 Bundle.FilesSetDefsPanel_interesting_overwriteSetPrompt(set.
getName()),
1324 Bundle.FilesSetDefsPanel_interesting_importOwConflict(),
1325 JOptionPane.YES_NO_CANCEL_OPTION,
1326 JOptionPane.QUESTION_MESSAGE,
1331 if (conflictChoice == JOptionPane.OK_OPTION) {
1333 return Pair.of(set, conflictChoice);
1336 return Pair.of(null, conflictChoice);
1350 "FilesSetDefsPanel.yesStandardFileConflictCreate=Yes, create",
1351 "# {0} - FilesSet name",
1352 "# {1} - New FilesSet name",
1353 "FilesSetDefsPanel.interesting.standardFileConflict=A standard interesting file set already exists with the name \"{0}.\" Would you like to rename your set to \"{1}?\"",})
1357 Object[] options = {
1358 Bundle.FilesSetDefsPanel_yesStandardFileConflictCreate(),
1359 Bundle.FilesSetDefsPanel_noSkipMsg(),
1360 Bundle.FilesSetDefsPanel_cancelImportMsg()
1363 String setName = set.
getName();
1364 String customSetName = Bundle.StandardInterestingFileSetsLoader_customSuffixed(set.
getName());
1366 int conflictChoice = JOptionPane.showOptionDialog(
this,
1367 Bundle.FilesSetDefsPanel_interesting_standardFileConflict(setName, customSetName),
1368 Bundle.FilesSetDefsPanel_interesting_importOwConflict(),
1369 JOptionPane.YES_NO_CANCEL_OPTION,
1370 JOptionPane.QUESTION_MESSAGE,
1376 if (conflictChoice == JOptionPane.OK_OPTION) {
1380 return Pair.of(null, conflictChoice);
1394 "FilesSetDefsPanel.cancelNewSetMsg=Cancel",
1395 "FilesSetDefsPanel.interesting.newOwConflict=Interesting files set conflict",})
1398 Object[] options = {
1399 Bundle.FilesSetDefsPanel_yesOwMsg(),
1400 Bundle.FilesSetDefsPanel_cancelNewSetMsg()
1402 int conflictChoice = JOptionPane.showOptionDialog(
this,
1403 Bundle.FilesSetDefsPanel_interesting_overwriteSetPrompt(set.
getName()),
1404 Bundle.FilesSetDefsPanel_interesting_newOwConflict(),
1405 JOptionPane.OK_CANCEL_OPTION,
1406 JOptionPane.QUESTION_MESSAGE,
1411 if (conflictChoice == JOptionPane.OK_OPTION) {
1413 return Pair.of(set, conflictChoice);
1416 return Pair.of(null, conflictChoice);
1432 Object[] options = {
1433 Bundle.FilesSetDefsPanel_yesStandardFileConflictCreate(),
1434 Bundle.FilesSetDefsPanel_cancelNewSetMsg()
1437 String setName = set.
getName();
1438 String customSetName = Bundle.StandardInterestingFileSetsLoader_customSuffixed(set.
getName());
1440 int conflictChoice = JOptionPane.showOptionDialog(
this,
1441 Bundle.FilesSetDefsPanel_interesting_standardFileConflict(setName, customSetName),
1442 Bundle.FilesSetDefsPanel_interesting_newOwConflict(),
1443 JOptionPane.OK_CANCEL_OPTION,
1444 JOptionPane.QUESTION_MESSAGE,
1450 if (conflictChoice == JOptionPane.OK_OPTION) {
1454 return Pair.of(null, conflictChoice);
1457 @NbBundle.Messages({
"FilesSetDefsPanel.interesting.exportButtonAction.featureName=Interesting Files Set Export",
1458 "# {0} - file name",
1459 "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt=File {0} exists, overwrite?",
1460 "FilesSetDefsPanel.interesting.ExportedMsg=Interesting files set exported",
1461 "FilesSetDefsPanel.interesting.failExportMsg=Export of interesting files set failed"})
1465 exportFileChooser.setSelectedFile(
new File(this.setsList.getSelectedValue().getName()));
1467 final File lastDirectory = getLastUsedDirectory(LAST_EXPORT_PATH_KEY);
1468 exportFileChooser.setCurrentDirectory(lastDirectory);
1470 int returnVal = exportFileChooser.showSaveDialog(
this);
1471 if (returnVal == JFileChooser.APPROVE_OPTION) {
1472 final String FEATURE_NAME = NbBundle.getMessage(this.getClass(),
1473 "FilesSetDefsPanel.interesting.exportButtonAction.featureName");
1474 File selFile = exportFileChooser.getSelectedFile();
1475 if (selFile == null) {
1476 JOptionPane.showMessageDialog(
this,
1477 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.failExportMsg"),
1479 JOptionPane.WARNING_MESSAGE);
1480 logger.warning(
"Selected file was null, when trying to export interesting files set definitions");
1487 String fileAbs = selFile.getAbsolutePath();
1488 if (!fileAbs.endsWith(
"." + XML_EXTENSION)) {
1489 fileAbs = fileAbs +
"." + XML_EXTENSION;
1490 selFile =
new File(fileAbs);
1492 if (selFile.exists()) {
1494 final String FILE_EXISTS_MESSAGE = NbBundle.getMessage(this.getClass(),
1495 "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt", selFile.getName());
1496 boolean shouldWrite = JOptionPane.showConfirmDialog(
this, FILE_EXISTS_MESSAGE, FEATURE_NAME, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION;
1501 List<FilesSet> exportSets;
1502 exportSets =
new ArrayList<>();
1504 exportSets.add(this.setsList.getSelectedValue());
1505 boolean written = InterestingItemsFilesSetSettings.exportXmlDefinitionsFile(selFile, exportSets);
1507 JOptionPane.showMessageDialog(
1508 WindowManager.getDefault().getMainWindow(),
1509 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.interesting.ExportedMsg"),
1511 JOptionPane.INFORMATION_MESSAGE);
1513 JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
1514 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.interesting.failExportMsg"),
1516 JOptionPane.WARNING_MESSAGE);
1517 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