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.HashMap;
26 import java.util.List;
28 import java.util.SortedSet;
29 import java.util.TreeMap;
30 import java.util.logging.Level;
31 import javax.swing.DefaultListModel;
32 import javax.swing.JButton;
33 import javax.swing.JFileChooser;
34 import javax.swing.JOptionPane;
35 import javax.swing.event.ListSelectionEvent;
36 import javax.swing.event.ListSelectionListener;
37 import javax.swing.filechooser.FileNameExtensionFilter;
38 import org.netbeans.spi.options.OptionsPanelController;
39 import org.openide.util.NbBundle;
40 import org.openide.windows.WindowManager;
52 @SuppressWarnings(
"PMD.SingularField")
55 private static final long serialVersionUID = 1L;
57 @NbBundle.Messages({
"# {0} - filter name",
58 "# {1} - profile name",
59 "FilesSetDefsPanel.ingest.fileFilterInUseError=The selected file filter, {0}, is being used by a profile, {1}, and cannot be deleted while any profile uses it.",
60 "FilesSetDefsPanel.bytes=Bytes",
61 "FilesSetDefsPanel.kiloBytes=Kilobytes",
62 "FilesSetDefsPanel.megaBytes=Megabytes",
63 "FilesSetDefsPanel.gigaBytes=Gigabytes",
64 "FilesSetDefsPanel.loadError=Error loading interesting files sets from file.",
65 "FilesSetDefsPanel.saveError=Error saving interesting files sets to file.",
66 "FilesSetDefsPanel.interesting.copySetButton.text=Copy Set",
67 "FilesSetDefsPanel.interesting.importSetButton.text=Import Set",
68 "FilesSetDefsPanel.interesting.exportSetButton.text=Export Set"
75 private final DefaultListModel<FilesSet> setsListModel =
new DefaultListModel<>();
76 private final DefaultListModel<
FilesSet.
Rule> rulesListModel =
new DefaultListModel<>();
78 private final JButton okButton =
new JButton(
"OK");
79 private final JButton cancelButton =
new JButton(
"Cancel");
83 private boolean canBeEnabled =
true;
98 this.panelType = panelType;
99 this.initComponents();
101 this.setsList.setModel(setsListModel);
103 this.rulesList.setModel(rulesListModel);
105 this.ingestWarningLabel.setVisible(
false);
107 this.copySetButton.setVisible(
false);
108 this.importSetButton.setVisible(
false);
109 this.exportSetButton.setVisible(
false);
110 this.mimeTypeComboBox.setVisible(
false);
111 this.jLabel7.setVisible(
false);
112 this.fileSizeUnitComboBox.setVisible(
false);
113 this.fileSizeSpinner.setVisible(
false);
114 this.filterDialogTitle =
"FilesSetPanel.filter.title";
115 this.ruleDialogTitle =
"FilesSetPanel.rule.title";
116 this.jLabel8.setVisible(
false);
117 this.equalitySignComboBox.setVisible(
false);
118 this.ignoreKnownFilesCheckbox.setVisible(
false);
119 this.jLabel2.setVisible(
false);
120 this.filesRadioButton.setVisible(
false);
121 this.dirsRadioButton.setVisible(
false);
122 this.allRadioButton.setVisible(
false);
123 this.jTextArea1.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.jTextArea1.text"));
124 org.openide.awt.Mnemonics.setLocalizedText(setsListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.setsListLabel.text"));
125 org.openide.awt.Mnemonics.setLocalizedText(editSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.editSetButton.text"));
126 org.openide.awt.Mnemonics.setLocalizedText(newSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.newSetButton.text"));
127 org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.deleteSetButton.text"));
128 org.openide.awt.Mnemonics.setLocalizedText(jLabel6,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.jLabel6.text"));
130 this.filterDialogTitle =
"FilesSetPanel.interesting.title";
131 this.ruleDialogTitle =
"FilesSetPanel.interesting.title";
132 this.ingoreUnallocCheckbox.setVisible(
false);
136 @NbBundle.Messages({
"FilesSetDefsPanel.Interesting.Title=Global Interesting Items Settings",
137 "FilesSetDefsPanel.Ingest.Title=File Filter Settings"})
140 setName(Bundle.FilesSetDefsPanel_Ingest_Title());
142 setName(Bundle.FilesSetDefsPanel_Interesting_Title());
147 detectableMimeTypes.forEach((type) -> {
148 mimeTypeComboBox.addItem(type);
151 logger.log(Level.SEVERE,
"Unable to get detectable file types", ex);
154 this.fileSizeUnitComboBox.setSelectedIndex(1);
155 this.equalitySignComboBox.setSelectedIndex(2);
169 logger.log(Level.WARNING, Bundle.FilesSetDefsPanel_saveError(), ex);
176 canBeEnabled = isEnabled;
177 newRuleButton.setEnabled(isEnabled);
178 copySetButton.setEnabled(isEnabled && setSelected);
179 newSetButton.setEnabled(isEnabled);
180 editRuleButton.setEnabled(isEnabled && ruleSelected);
181 editSetButton.setEnabled(isEnabled && setSelected);
182 exportSetButton.setEnabled(setSelected);
183 importSetButton.setEnabled(isEnabled);
184 deleteRuleButton.setEnabled(isEnabled && ruleSelected);
185 deleteSetButton.setEnabled(isEnabled && setSelected);
186 ingestWarningLabel.setVisible(!isEnabled);
196 this.resetComponents();
209 logger.log(Level.WARNING, Bundle.FilesSetDefsPanel_loadError(), ex);
210 this.filesSets =
new TreeMap<>();
215 this.filesSets.values().forEach((set) -> {
216 this.setsListModel.addElement(set);
219 if (!this.filesSets.isEmpty()) {
222 EventQueue.invokeLater(() -> {
232 this.resetRuleComponents();
233 this.setsListModel.clear();
234 this.setDescriptionTextArea.setText(
"");
235 this.ignoreKnownFilesCheckbox.setSelected(
true);
236 this.ingoreUnallocCheckbox.setSelected(
true);
237 this.newSetButton.setEnabled(
true && canBeEnabled);
238 this.editSetButton.setEnabled(
false);
239 this.copySetButton.setEnabled(
false);
240 this.exportSetButton.setEnabled(
false);
241 this.importSetButton.setEnabled(
true && canBeEnabled);
242 this.deleteSetButton.setEnabled(
false);
250 this.fileNameTextField.setText(
"");
251 this.fileNameRadioButton.setSelected(
true);
252 this.fileNameRegexCheckbox.setSelected(
false);
253 this.filesRadioButton.setSelected(
true);
254 this.rulePathConditionTextField.setText(
"");
255 this.daysIncludedTextField.setText(
"");
256 this.rulePathConditionRegexCheckBox.setSelected(
false);
257 this.mimeTypeComboBox.setSelectedIndex(0);
258 this.equalitySignComboBox.setSelectedIndex(2);
259 this.fileSizeUnitComboBox.setSelectedIndex(1);
260 this.fileSizeSpinner.setValue(0);
261 this.newRuleButton.setEnabled(!this.setsListModel.isEmpty() && canBeEnabled);
262 this.editRuleButton.setEnabled(
false);
263 this.deleteRuleButton.setEnabled(
false);
273 if (e.getValueIsAdjusting()) {
285 if (selectedSet != null) {
298 rules.values().forEach((rule) -> {
318 if (e.getValueIsAdjusting()) {
334 if (nameCondition != null) {
345 switch (typeCondition.getMetaType()) {
352 case FILES_AND_DIRECTORIES:
356 if (pathCondition != null) {
363 if (mimeTypeCondition != null) {
368 if (fileSizeCondition != null) {
377 if (dateCondition != null){
408 if (selectedSet != null) {
419 int option = JOptionPane.OK_OPTION;
421 option = JOptionPane.showConfirmDialog(
this, panel, NbBundle.getMessage(
FilesSetPanel.class, filterDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
422 }
while (option == JOptionPane.OK_OPTION && !panel.isValidDefinition());
426 if (this.filesSets.containsKey(panel.getFilesSetName()) && shouldCreateNew) {
428 "FilesSetDefsPanel.doFileSetsDialog.duplicateRuleSet.text",
429 panel.getFilesSetName()));
433 if (option == JOptionPane.OK_OPTION) {
435 if (selectedSet != null) {
439 rules.putAll(selectedSet.
getRules());
441 if (shouldCreateNew) {
442 this.replaceFilesSet(null, panel.getFilesSetName(), panel.getFilesSetDescription(), panel.getFileSetIgnoresKnownFiles(), panel.getFileSetIgnoresUnallocatedSpace(), rules);
444 this.replaceFilesSet(selectedSet, panel.getFilesSetName(), panel.getFilesSetDescription(), panel.getFileSetIgnoresKnownFiles(), panel.getFileSetIgnoresUnallocatedSpace(), rules);
458 FilesSetRulePanel panel;
459 if (selectedRule != null) {
461 panel =
new FilesSetRulePanel(selectedRule, okButton, cancelButton, panelType);
464 panel =
new FilesSetRulePanel(okButton, cancelButton, panelType);
469 int option = JOptionPane.OK_OPTION;
471 option = JOptionPane.showOptionDialog(
this, panel, NbBundle.getMessage(
FilesSetPanel.class, ruleDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null,
new Object[]{okButton, cancelButton}, okButton);
473 }
while (option == JOptionPane.OK_OPTION && !panel.isValidRuleDefinition());
475 if (option == JOptionPane.OK_OPTION) {
479 FilesSet selectedSet = this.setsList.getSelectedValue();
484 if (selectedRule != null) {
485 rules.remove(selectedRule.getUuid());
487 FilesSet.
Rule newRule =
new FilesSet.
Rule(panel.getRuleName(), panel.getFileNameCondition(), panel.getMetaTypeCondition(), panel.getPathCondition(), panel.getMimeTypeCondition(), panel.getFileSizeCondition(), panel.getDateCondition());
488 rules.put(newRule.getUuid(), newRule);
497 EventQueue.invokeLater(() -> {
498 this.rulesList.setSelectedValue(newRule,
true);
518 void replaceFilesSet(
FilesSet oldSet, String name, String description,
boolean ignoresKnownFiles,
boolean ignoresUnallocatedSpace, Map<String, FilesSet.Rule> rules) {
519 if (oldSet != null) {
522 this.filesSets.remove(oldSet.
getName());
527 FilesSet newSet =
new FilesSet(name, description, ignoresKnownFiles, ignoresUnallocatedSpace, rules);
528 this.filesSets.put(newSet.getName(), newSet);
532 FilesSetDefsPanel.this.setsListModel.clear();
533 this.filesSets.values().forEach((set) -> {
534 this.setsListModel.addElement(set);
540 this.setsList.setSelectedValue(newSet,
true);
548 @SuppressWarnings(
"unchecked")
550 private
void initComponents() {
552 fileNameButtonGroup =
new javax.swing.ButtonGroup();
553 typeButtonGroup =
new javax.swing.ButtonGroup();
554 jScrollPane1 =
new javax.swing.JScrollPane();
555 jPanel1 =
new javax.swing.JPanel();
556 jLabel6 =
new javax.swing.JLabel();
557 newRuleButton =
new javax.swing.JButton();
558 filesRadioButton =
new javax.swing.JRadioButton();
559 editRuleButton =
new javax.swing.JButton();
560 rulesListLabel =
new javax.swing.JLabel();
561 rulesListScrollPane =
new javax.swing.JScrollPane();
562 rulesList =
new javax.swing.JList<>();
563 setDescScrollPanel =
new javax.swing.JScrollPane();
564 setDescriptionTextArea =
new javax.swing.JTextArea();
565 editSetButton =
new javax.swing.JButton();
566 setsListScrollPane =
new javax.swing.JScrollPane();
567 setsList =
new javax.swing.JList<>();
568 fileNameExtensionRadioButton =
new javax.swing.JRadioButton();
569 jLabel3 =
new javax.swing.JLabel();
570 fileNameTextField =
new javax.swing.JTextField();
571 jLabel5 =
new javax.swing.JLabel();
572 fileNameRadioButton =
new javax.swing.JRadioButton();
573 rulePathConditionTextField =
new javax.swing.JTextField();
574 ignoreKnownFilesCheckbox =
new javax.swing.JCheckBox();
575 fileNameRegexCheckbox =
new javax.swing.JCheckBox();
576 separator =
new javax.swing.JSeparator();
577 setsListLabel =
new javax.swing.JLabel();
578 allRadioButton =
new javax.swing.JRadioButton();
579 deleteSetButton =
new javax.swing.JButton();
580 deleteRuleButton =
new javax.swing.JButton();
581 newSetButton =
new javax.swing.JButton();
582 jLabel2 =
new javax.swing.JLabel();
583 dirsRadioButton =
new javax.swing.JRadioButton();
584 jLabel1 =
new javax.swing.JLabel();
585 jLabel4 =
new javax.swing.JLabel();
586 rulePathConditionRegexCheckBox =
new javax.swing.JCheckBox();
587 jScrollPane2 =
new javax.swing.JScrollPane();
588 jTextArea1 =
new javax.swing.JTextArea();
589 jLabel7 =
new javax.swing.JLabel();
590 mimeTypeComboBox =
new javax.swing.JComboBox<>();
591 jLabel8 =
new javax.swing.JLabel();
592 equalitySignComboBox =
new javax.swing.JComboBox<String>();
593 fileSizeSpinner =
new javax.swing.JSpinner();
594 fileSizeUnitComboBox =
new javax.swing.JComboBox<String>();
595 ingoreUnallocCheckbox =
new javax.swing.JCheckBox();
596 ingestWarningLabel =
new javax.swing.JLabel();
597 copySetButton =
new javax.swing.JButton();
598 importSetButton =
new javax.swing.JButton();
599 exportSetButton =
new javax.swing.JButton();
600 modifiedDateLabel =
new javax.swing.JLabel();
601 daysIncludedTextField =
new javax.swing.JTextField();
602 daysIncludedLabel =
new javax.swing.JLabel();
604 setFont(getFont().deriveFont(getFont().getStyle() & ~java.awt.Font.BOLD, 11));
606 jScrollPane1.setFont(jScrollPane1.getFont().deriveFont(jScrollPane1.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
608 jPanel1.setFont(jPanel1.getFont().deriveFont(jPanel1.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
610 jLabel6.setFont(jLabel6.getFont().deriveFont(jLabel6.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
611 org.openide.awt.Mnemonics.setLocalizedText(jLabel6,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.jLabel6.text"));
613 newRuleButton.setFont(newRuleButton.getFont().deriveFont(newRuleButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
614 newRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
615 org.openide.awt.Mnemonics.setLocalizedText(newRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.newRuleButton.text"));
616 newRuleButton.addActionListener(
new java.awt.event.ActionListener() {
617 public void actionPerformed(java.awt.event.ActionEvent evt) {
618 newRuleButtonActionPerformed(evt);
622 typeButtonGroup.add(filesRadioButton);
623 filesRadioButton.setFont(filesRadioButton.getFont().deriveFont(filesRadioButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
624 filesRadioButton.setSelected(
true);
625 org.openide.awt.Mnemonics.setLocalizedText(filesRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.filesRadioButton.text"));
626 filesRadioButton.setEnabled(
false);
628 editRuleButton.setFont(editRuleButton.getFont().deriveFont(editRuleButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
629 editRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/edit16.png")));
630 org.openide.awt.Mnemonics.setLocalizedText(editRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.editRuleButton.text"));
631 editRuleButton.setEnabled(
false);
632 editRuleButton.addActionListener(
new java.awt.event.ActionListener() {
633 public void actionPerformed(java.awt.event.ActionEvent evt) {
634 editRuleButtonActionPerformed(evt);
638 rulesListLabel.setFont(rulesListLabel.getFont().deriveFont(rulesListLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
639 org.openide.awt.Mnemonics.setLocalizedText(rulesListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulesListLabel.text"));
641 rulesListScrollPane.setFont(rulesListScrollPane.getFont().deriveFont(rulesListScrollPane.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
643 rulesList.setFont(rulesList.getFont().deriveFont(rulesList.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
644 rulesList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
645 rulesListScrollPane.setViewportView(rulesList);
647 setDescScrollPanel.setFont(setDescScrollPanel.getFont().deriveFont(setDescScrollPanel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
648 setDescScrollPanel.setMinimumSize(
new java.awt.Dimension(10, 22));
649 setDescScrollPanel.setPreferredSize(
new java.awt.Dimension(14, 40));
651 setDescriptionTextArea.setEditable(
false);
652 setDescriptionTextArea.setBackground(
new java.awt.Color(240, 240, 240));
653 setDescriptionTextArea.setColumns(20);
654 setDescriptionTextArea.setFont(setDescriptionTextArea.getFont().deriveFont(setDescriptionTextArea.getFont().getStyle() & ~java.awt.Font.BOLD, 13));
655 setDescriptionTextArea.setLineWrap(
true);
656 setDescriptionTextArea.setRows(6);
657 setDescriptionTextArea.setMinimumSize(
new java.awt.Dimension(10, 22));
658 setDescScrollPanel.setViewportView(setDescriptionTextArea);
660 editSetButton.setFont(editSetButton.getFont().deriveFont(editSetButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
661 editSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/edit16.png")));
662 org.openide.awt.Mnemonics.setLocalizedText(editSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.editSetButton.text"));
663 editSetButton.setEnabled(
false);
664 editSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
665 editSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
666 editSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
667 editSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
668 editSetButton.addActionListener(
new java.awt.event.ActionListener() {
669 public void actionPerformed(java.awt.event.ActionEvent evt) {
670 editSetButtonActionPerformed(evt);
674 setsListScrollPane.setFont(setsListScrollPane.getFont().deriveFont(setsListScrollPane.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
676 setsList.setFont(setsList.getFont().deriveFont(setsList.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
677 setsList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
678 setsListScrollPane.setViewportView(setsList);
680 fileNameButtonGroup.add(fileNameExtensionRadioButton);
681 fileNameExtensionRadioButton.setFont(fileNameExtensionRadioButton.getFont().deriveFont(fileNameExtensionRadioButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
682 org.openide.awt.Mnemonics.setLocalizedText(fileNameExtensionRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameExtensionRadioButton.text"));
683 fileNameExtensionRadioButton.setEnabled(
false);
685 jLabel3.setFont(jLabel3.getFont().deriveFont(jLabel3.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
686 org.openide.awt.Mnemonics.setLocalizedText(jLabel3,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.jLabel3.text"));
688 fileNameTextField.setEditable(
false);
689 fileNameTextField.setFont(fileNameTextField.getFont().deriveFont(fileNameTextField.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
690 fileNameTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameTextField.text"));
692 jLabel5.setFont(jLabel5.getFont().deriveFont(jLabel5.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
693 org.openide.awt.Mnemonics.setLocalizedText(jLabel5,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.jLabel5.text"));
695 fileNameButtonGroup.add(fileNameRadioButton);
696 fileNameRadioButton.setFont(fileNameRadioButton.getFont().deriveFont(fileNameRadioButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
697 org.openide.awt.Mnemonics.setLocalizedText(fileNameRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameRadioButton.text"));
698 fileNameRadioButton.setEnabled(
false);
700 rulePathConditionTextField.setEditable(
false);
701 rulePathConditionTextField.setFont(rulePathConditionTextField.getFont().deriveFont(rulePathConditionTextField.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
702 rulePathConditionTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulePathConditionTextField.text"));
704 ignoreKnownFilesCheckbox.setFont(ignoreKnownFilesCheckbox.getFont().deriveFont(ignoreKnownFilesCheckbox.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
705 org.openide.awt.Mnemonics.setLocalizedText(ignoreKnownFilesCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ignoreKnownFilesCheckbox.text"));
706 ignoreKnownFilesCheckbox.setEnabled(
false);
708 fileNameRegexCheckbox.setFont(fileNameRegexCheckbox.getFont().deriveFont(fileNameRegexCheckbox.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
709 org.openide.awt.Mnemonics.setLocalizedText(fileNameRegexCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameRegexCheckbox.text"));
710 fileNameRegexCheckbox.setEnabled(
false);
711 fileNameRegexCheckbox.addActionListener(
new java.awt.event.ActionListener() {
712 public void actionPerformed(java.awt.event.ActionEvent evt) {
713 fileNameRegexCheckboxActionPerformed(evt);
717 separator.setOrientation(javax.swing.SwingConstants.VERTICAL);
719 setsListLabel.setFont(setsListLabel.getFont().deriveFont(setsListLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
720 org.openide.awt.Mnemonics.setLocalizedText(setsListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.setsListLabel.text"));
722 typeButtonGroup.add(allRadioButton);
723 allRadioButton.setFont(allRadioButton.getFont().deriveFont(allRadioButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
724 org.openide.awt.Mnemonics.setLocalizedText(allRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.allRadioButton.text"));
725 allRadioButton.setEnabled(
false);
727 deleteSetButton.setFont(deleteSetButton.getFont().deriveFont(deleteSetButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
728 deleteSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
729 org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.deleteSetButton.text"));
730 deleteSetButton.setEnabled(
false);
731 deleteSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
732 deleteSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
733 deleteSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
734 deleteSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
735 deleteSetButton.addActionListener(
new java.awt.event.ActionListener() {
736 public void actionPerformed(java.awt.event.ActionEvent evt) {
737 deleteSetButtonActionPerformed(evt);
741 deleteRuleButton.setFont(deleteRuleButton.getFont().deriveFont(deleteRuleButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
742 deleteRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
743 org.openide.awt.Mnemonics.setLocalizedText(deleteRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.deleteRuleButton.text"));
744 deleteRuleButton.setEnabled(
false);
745 deleteRuleButton.addActionListener(
new java.awt.event.ActionListener() {
746 public void actionPerformed(java.awt.event.ActionEvent evt) {
747 deleteRuleButtonActionPerformed(evt);
751 newSetButton.setFont(newSetButton.getFont().deriveFont(newSetButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
752 newSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
753 org.openide.awt.Mnemonics.setLocalizedText(newSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.newSetButton.text"));
754 newSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
755 newSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
756 newSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
757 newSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
758 newSetButton.addActionListener(
new java.awt.event.ActionListener() {
759 public void actionPerformed(java.awt.event.ActionEvent evt) {
760 newSetButtonActionPerformed(evt);
764 jLabel2.setFont(jLabel2.getFont().deriveFont(jLabel2.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
765 org.openide.awt.Mnemonics.setLocalizedText(jLabel2,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.jLabel2.text"));
767 typeButtonGroup.add(dirsRadioButton);
768 dirsRadioButton.setFont(dirsRadioButton.getFont().deriveFont(dirsRadioButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
769 org.openide.awt.Mnemonics.setLocalizedText(dirsRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.dirsRadioButton.text"));
770 dirsRadioButton.setEnabled(
false);
772 jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
773 org.openide.awt.Mnemonics.setLocalizedText(jLabel1,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.jLabel1.text"));
775 jLabel4.setFont(jLabel4.getFont().deriveFont(jLabel4.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
776 org.openide.awt.Mnemonics.setLocalizedText(jLabel4,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.jLabel4.text"));
778 rulePathConditionRegexCheckBox.setFont(rulePathConditionRegexCheckBox.getFont().deriveFont(rulePathConditionRegexCheckBox.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
779 org.openide.awt.Mnemonics.setLocalizedText(rulePathConditionRegexCheckBox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulePathConditionRegexCheckBox.text"));
780 rulePathConditionRegexCheckBox.setEnabled(
false);
782 jScrollPane2.setFont(jScrollPane2.getFont().deriveFont(jScrollPane2.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
784 jTextArea1.setEditable(
false);
785 jTextArea1.setBackground(
new java.awt.Color(240, 240, 240));
786 jTextArea1.setColumns(20);
787 jTextArea1.setFont(jTextArea1.getFont().deriveFont(jTextArea1.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
788 jTextArea1.setLineWrap(
true);
789 jTextArea1.setRows(3);
790 jTextArea1.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.jTextArea1.text"));
791 jTextArea1.setWrapStyleWord(
true);
792 jScrollPane2.setViewportView(jTextArea1);
794 org.openide.awt.Mnemonics.setLocalizedText(jLabel7,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.jLabel7.text"));
796 mimeTypeComboBox.setBackground(
new java.awt.Color(240, 240, 240));
797 mimeTypeComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] {
""}));
798 mimeTypeComboBox.setEnabled(
false);
799 mimeTypeComboBox.setMinimumSize(
new java.awt.Dimension(0, 20));
800 mimeTypeComboBox.setPreferredSize(
new java.awt.Dimension(12, 20));
802 org.openide.awt.Mnemonics.setLocalizedText(jLabel8,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.jLabel8.text"));
804 equalitySignComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] {
"=",
">",
"≥",
"<",
"≤" }));
805 equalitySignComboBox.setEnabled(
false);
807 fileSizeSpinner.setEnabled(
false);
808 fileSizeSpinner.setMinimumSize(
new java.awt.Dimension(2, 20));
810 fileSizeUnitComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] { Bundle.FilesSetDefsPanel_bytes(), Bundle.FilesSetDefsPanel_kiloBytes(), Bundle.FilesSetDefsPanel_megaBytes(), Bundle.FilesSetDefsPanel_gigaBytes() }));
811 fileSizeUnitComboBox.setEnabled(
false);
813 org.openide.awt.Mnemonics.setLocalizedText(ingoreUnallocCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingoreUnallocCheckbox.text"));
814 ingoreUnallocCheckbox.setToolTipText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingoreUnallocCheckbox.toolTipText"));
815 ingoreUnallocCheckbox.setEnabled(
false);
817 ingestWarningLabel.setFont(ingestWarningLabel.getFont().deriveFont(ingestWarningLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
818 ingestWarningLabel.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png")));
819 org.openide.awt.Mnemonics.setLocalizedText(ingestWarningLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingestWarningLabel.text"));
821 copySetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/new16.png")));
822 org.openide.awt.Mnemonics.setLocalizedText(copySetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.copySetButton.text"));
823 copySetButton.setEnabled(
false);
824 copySetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
825 copySetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
826 copySetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
827 copySetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
828 copySetButton.addActionListener(
new java.awt.event.ActionListener() {
829 public void actionPerformed(java.awt.event.ActionEvent evt) {
830 copySetButtonActionPerformed(evt);
834 importSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/import16.png")));
835 org.openide.awt.Mnemonics.setLocalizedText(importSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.importSetButton.text"));
836 importSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
837 importSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
838 importSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
839 importSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
840 importSetButton.addActionListener(
new java.awt.event.ActionListener() {
841 public void actionPerformed(java.awt.event.ActionEvent evt) {
842 importSetButtonActionPerformed(evt);
846 exportSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/export16.png")));
847 org.openide.awt.Mnemonics.setLocalizedText(exportSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.exportSetButton.text"));
848 exportSetButton.setEnabled(
false);
849 exportSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
850 exportSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
851 exportSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
852 exportSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
853 exportSetButton.addActionListener(
new java.awt.event.ActionListener() {
854 public void actionPerformed(java.awt.event.ActionEvent evt) {
855 exportSetButtonActionPerformed(evt);
859 org.openide.awt.Mnemonics.setLocalizedText(modifiedDateLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.modifiedDateLabel.text"));
861 daysIncludedTextField.setEditable(
false);
862 daysIncludedTextField.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
863 daysIncludedTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.daysIncludedTextField.text"));
864 daysIncludedTextField.setMinimumSize(
new java.awt.Dimension(60, 20));
865 daysIncludedTextField.setPreferredSize(
new java.awt.Dimension(60, 20));
867 org.openide.awt.Mnemonics.setLocalizedText(daysIncludedLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.daysIncludedLabel.text"));
868 daysIncludedLabel.setEnabled(
false);
870 javax.swing.GroupLayout jPanel1Layout =
new javax.swing.GroupLayout(jPanel1);
871 jPanel1.setLayout(jPanel1Layout);
872 jPanel1Layout.setHorizontalGroup(
873 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
874 .addGroup(jPanel1Layout.createSequentialGroup()
876 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
877 .addGroup(jPanel1Layout.createSequentialGroup()
878 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
false)
879 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
880 .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
881 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
882 .addComponent(importSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
883 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
884 .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
885 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
886 .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
887 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
888 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
889 .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
890 .addComponent(deleteSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
891 .addComponent(setsListScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
892 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
893 .addComponent(setsListLabel))
894 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
895 .addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
896 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
897 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
898 .addGroup(jPanel1Layout.createSequentialGroup()
899 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
900 .addComponent(rulesListScrollPane, javax.swing.GroupLayout.Alignment.TRAILING)
901 .addComponent(setDescScrollPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
902 .addGroup(jPanel1Layout.createSequentialGroup()
904 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
905 .addComponent(jLabel7)
906 .addComponent(jLabel8)
907 .addComponent(jLabel2)
908 .addComponent(jLabel4)
909 .addComponent(modifiedDateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
910 .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
911 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
912 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
913 .addComponent(rulePathConditionTextField)
914 .addComponent(fileNameTextField, javax.swing.GroupLayout.Alignment.TRAILING)
915 .addComponent(mimeTypeComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
916 .addGroup(jPanel1Layout.createSequentialGroup()
917 .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
918 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
919 .addComponent(fileSizeSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
920 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
921 .addComponent(fileSizeUnitComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
922 .addGroup(jPanel1Layout.createSequentialGroup()
923 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
924 .addComponent(rulePathConditionRegexCheckBox)
925 .addGroup(jPanel1Layout.createSequentialGroup()
926 .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
927 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
928 .addComponent(daysIncludedLabel))
929 .addGroup(jPanel1Layout.createSequentialGroup()
930 .addComponent(filesRadioButton)
931 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
932 .addComponent(dirsRadioButton)
933 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
934 .addComponent(allRadioButton))
935 .addGroup(jPanel1Layout.createSequentialGroup()
936 .addComponent(fileNameRadioButton)
937 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
938 .addComponent(fileNameExtensionRadioButton)
939 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
940 .addComponent(fileNameRegexCheckbox)))
941 .addGap(0, 0, Short.MAX_VALUE)))))
943 .addGroup(jPanel1Layout.createSequentialGroup()
944 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
945 .addComponent(rulesListLabel)
946 .addGroup(jPanel1Layout.createSequentialGroup()
947 .addComponent(ignoreKnownFilesCheckbox)
948 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
949 .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
950 .addGroup(jPanel1Layout.createSequentialGroup()
951 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
952 .addComponent(jLabel5)
953 .addComponent(jLabel6))
954 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
955 .addComponent(ingestWarningLabel))
956 .addComponent(jLabel1)
957 .addGroup(jPanel1Layout.createSequentialGroup()
958 .addComponent(newRuleButton)
960 .addComponent(editRuleButton)
962 .addComponent(deleteRuleButton)))
963 .addGap(24, 47, Short.MAX_VALUE))))
966 jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {copySetButton, deleteSetButton, editSetButton, exportSetButton, importSetButton, newSetButton});
968 jPanel1Layout.setVerticalGroup(
969 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
970 .addGroup(jPanel1Layout.createSequentialGroup()
972 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
973 .addComponent(separator)
974 .addGroup(jPanel1Layout.createSequentialGroup()
975 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
976 .addGroup(jPanel1Layout.createSequentialGroup()
977 .addComponent(jLabel6)
978 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
979 .addComponent(jLabel5)
981 .addComponent(ingestWarningLabel, javax.swing.GroupLayout.Alignment.TRAILING))
982 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
983 .addComponent(setDescScrollPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
984 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
985 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
986 .addComponent(ignoreKnownFilesCheckbox)
987 .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
988 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
989 .addComponent(rulesListLabel)
990 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
991 .addComponent(rulesListScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE)
992 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
993 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
994 .addComponent(newRuleButton)
995 .addComponent(editRuleButton)
996 .addComponent(deleteRuleButton))
997 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
998 .addComponent(jLabel1)
999 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1000 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1001 .addComponent(jLabel2)
1002 .addComponent(filesRadioButton)
1003 .addComponent(dirsRadioButton)
1004 .addComponent(allRadioButton))
1005 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1006 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1007 .addComponent(jLabel3)
1008 .addComponent(fileNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
1009 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1010 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1011 .addComponent(fileNameRadioButton)
1012 .addComponent(fileNameExtensionRadioButton)
1013 .addComponent(fileNameRegexCheckbox))
1014 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1015 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1016 .addComponent(jLabel4)
1017 .addComponent(rulePathConditionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
1018 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1019 .addComponent(rulePathConditionRegexCheckBox)
1020 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1021 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1022 .addComponent(jLabel7)
1023 .addComponent(mimeTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1024 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1025 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1026 .addComponent(jLabel8)
1027 .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1028 .addComponent(fileSizeSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1029 .addComponent(fileSizeUnitComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1030 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1031 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1032 .addComponent(modifiedDateLabel)
1033 .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1034 .addComponent(daysIncludedLabel))
1036 .addGroup(jPanel1Layout.createSequentialGroup()
1037 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1038 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1039 .addComponent(setsListLabel)
1040 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1041 .addComponent(setsListScrollPane)
1042 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1043 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1044 .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1045 .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1046 .addComponent(deleteSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1047 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1048 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1049 .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1050 .addComponent(importSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1051 .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1055 jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL,
new java.awt.Component[] {copySetButton, deleteRuleButton, deleteSetButton, editRuleButton, editSetButton, exportSetButton, importSetButton, newRuleButton, newSetButton});
1057 jScrollPane1.setViewportView(jPanel1);
1059 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
1060 this.setLayout(layout);
1061 layout.setHorizontalGroup(
1062 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1063 .addComponent(jScrollPane1)
1065 layout.setVerticalGroup(
1066 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1067 .addComponent(jScrollPane1)
1072 this.doFileSetsDialog(null,
true);
1073 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1081 FilesSet oldSet = this.setsList.getSelectedValue();
1083 FilesSet.
Rule selectedRule = this.rulesList.getSelectedValue();
1084 rules.remove(selectedRule.getUuid());
1086 if (!this.rulesListModel.isEmpty()) {
1087 this.rulesList.setSelectedIndex(0);
1089 this.resetRuleComponents();
1091 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1095 FilesSet selectedSet = this.setsList.getSelectedValue();
1098 if (profile.getFileIngestFilter().equals(selectedSet.
getName())) {
1100 "FilesSetDefsPanel.ingest.fileFilterInUseError",
1101 selectedSet.
getName(), profile.toString()));
1107 this.filesSets.remove(selectedSet.
getName());
1108 this.setsListModel.removeElement(selectedSet);
1111 if (!this.filesSets.isEmpty()) {
1112 this.setsList.setSelectedIndex(0);
1114 this.resetComponents();
1116 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1120 this.doFileSetsDialog(this.setsList.getSelectedValue(),
false);
1121 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1125 this.doFilesSetRuleDialog(this.rulesList.getSelectedValue());
1126 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1130 this.doFilesSetRuleDialog(null);
1131 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1135 this.doFileSetsDialog(this.setsList.getSelectedValue(),
true);
1136 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1138 @NbBundle.Messages({
1139 "FilesSetDefsPanel.yesOwMsg=Yes, overwrite",
1140 "FilesSetDefsPanel.noSkipMsg=No, skip",
1141 "FilesSetDefsPanel.cancelImportMsg=Cancel import",
1142 "# {0} - FilesSet name",
1143 "FilesSetDefsPanel.interesting.overwriteSetPrompt=Interesting files set <{0}> already exists locally, overwrite?",
1144 "FilesSetDefsPanel.interesting.importOwConflict=Import Interesting files set conflict",
1145 "FilesSetDefsPanel.interesting.failImportMsg=Interesting files set not imported",
1146 "FilesSetDefsPanel.interesting.fileExtensionFilterLbl=Autopsy Interesting File Set File (xml)",
1147 "FilesSetDefsPanel.interesting.importButtonAction.featureName=Interesting Files Set Import"
1151 FilesSet selectedSet = this.setsList.getSelectedValue();
1152 JFileChooser chooser =
new JFileChooser();
1153 final String EXTENSION =
"xml";
1154 FileNameExtensionFilter autopsyFilter =
new FileNameExtensionFilter(
1155 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.fileExtensionFilterLbl"), EXTENSION);
1156 chooser.addChoosableFileFilter(autopsyFilter);
1157 chooser.setAcceptAllFileFilterUsed(
false);
1158 chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
1159 int returnVal = chooser.showOpenDialog(
this);
1160 if (returnVal == JFileChooser.APPROVE_OPTION) {
1161 File selFile = chooser.getSelectedFile();
1162 if (selFile == null) {
1163 JOptionPane.showMessageDialog(
this,
1164 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.failImportMsg"),
1165 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.importButtonAction.featureName"),
1166 JOptionPane.WARNING_MESSAGE);
1167 logger.warning(
"Selected file was null, when trying to import interesting files set definitions");
1170 Collection<FilesSet> importedSets;
1172 importedSets = InterestingItemsFilesSetSettings.readDefinitionsXML(selFile).values();
1173 if (importedSets.isEmpty()) {
1177 JOptionPane.showMessageDialog(
this,
1178 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.failImportMsg"),
1179 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.importButtonAction.featureName"),
1180 JOptionPane.WARNING_MESSAGE);
1181 logger.log(Level.WARNING,
"No Interesting files set definitions were read from the selected file, exception", ex);
1184 for (
FilesSet set : importedSets) {
1185 int choice = JOptionPane.OK_OPTION;
1186 if (filesSets.containsKey(set.getName())) {
1187 Object[] options = {NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.yesOwMsg"),
1188 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.noSkipMsg"),
1189 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.cancelImportMsg")};
1190 choice = JOptionPane.showOptionDialog(
this,
1191 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.overwriteSetPrompt", set.getName()),
1192 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.importOwConflict"),
1193 JOptionPane.YES_NO_CANCEL_OPTION,
1194 JOptionPane.QUESTION_MESSAGE,
1199 if (choice == JOptionPane.OK_OPTION) {
1201 this.filesSets.put(set.getName(), set);
1202 }
else if (choice == JOptionPane.CANCEL_OPTION) {
1208 this.filesSets.values().forEach((set) -> {
1209 this.setsListModel.addElement(set);
1214 this.setsList.setSelectedValue(selectedSet,
true);
1215 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1220 @NbBundle.Messages({
"FilesSetDefsPanel.interesting.exportButtonAction.featureName=Interesting Files Set Export",
1221 "# {0} - file name",
1222 "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt=File {0} exists, overwrite?",
1223 "FilesSetDefsPanel.interesting.ExportedMsg=Interesting files set exported",
1224 "FilesSetDefsPanel.interesting.failExportMsg=Export of interesting files set failed"})
1228 JFileChooser chooser =
new JFileChooser();
1229 final String EXTENSION =
"xml";
1230 FileNameExtensionFilter autopsyFilter =
new FileNameExtensionFilter(
1231 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.fileExtensionFilterLbl"), EXTENSION);
1232 chooser.addChoosableFileFilter(autopsyFilter);
1233 chooser.setSelectedFile(
new File(this.setsList.getSelectedValue().getName()));
1234 chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
1235 int returnVal = chooser.showSaveDialog(
this);
1236 if (returnVal == JFileChooser.APPROVE_OPTION) {
1237 final String FEATURE_NAME = NbBundle.getMessage(this.getClass(),
1238 "FilesSetDefsPanel.interesting.exportButtonAction.featureName");
1239 File selFile = chooser.getSelectedFile();
1240 if (selFile == null) {
1241 JOptionPane.showMessageDialog(
this,
1242 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.failExportMsg"),
1244 JOptionPane.WARNING_MESSAGE);
1245 logger.warning(
"Selected file was null, when trying to export interesting files set definitions");
1249 String fileAbs = selFile.getAbsolutePath();
1250 if (!fileAbs.endsWith(
"." + EXTENSION)) {
1251 fileAbs = fileAbs +
"." + EXTENSION;
1252 selFile =
new File(fileAbs);
1254 if (selFile.exists()) {
1256 final String FILE_EXISTS_MESSAGE = NbBundle.getMessage(this.getClass(),
1257 "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt", selFile.getName());
1258 boolean shouldWrite = JOptionPane.showConfirmDialog(
this, FILE_EXISTS_MESSAGE, FEATURE_NAME, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION;
1263 List<FilesSet> exportSets;
1264 exportSets =
new ArrayList<>();
1266 exportSets.add(this.setsList.getSelectedValue());
1267 boolean written = InterestingItemsFilesSetSettings.exportXmlDefinitionsFile(selFile, exportSets);
1269 JOptionPane.showMessageDialog(
1270 WindowManager.getDefault().getMainWindow(),
1271 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.interesting.ExportedMsg"),
1273 JOptionPane.INFORMATION_MESSAGE);
1275 JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
1276 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.interesting.failExportMsg"),
1278 JOptionPane.WARNING_MESSAGE);
1279 logger.warning(
"Export of interesting files set failed unable to write definitions xml file");
void deleteRuleButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JLabel daysIncludedLabel
javax.swing.JPanel jPanel1
javax.swing.JLabel jLabel4
javax.swing.JRadioButton fileNameExtensionRadioButton
javax.swing.JComboBox< String > fileSizeUnitComboBox
void valueChanged(ListSelectionEvent e)
javax.swing.JLabel jLabel6
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 jLabel1
javax.swing.JButton exportSetButton
Map< String, FilesSet > getInterestingFilesSets()
void deleteSetButtonActionPerformed(java.awt.event.ActionEvent evt)
final DefaultListModel< FilesSet > setsListModel
void editRuleButtonActionPerformed(java.awt.event.ActionEvent evt)
void exportSetButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JScrollPane rulesListScrollPane
javax.swing.JScrollPane setDescScrollPanel
javax.swing.JButton newSetButton
javax.swing.JLabel rulesListLabel
static synchronized FilesSetsManager getInstance()
javax.swing.JScrollPane setsListScrollPane
void copySetButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JLabel jLabel7
javax.swing.JList< FilesSet > setsList
Map< String, FilesSet > getCustomFileIngestFilters()
javax.swing.JSpinner fileSizeSpinner
javax.swing.JTextArea jTextArea1
javax.swing.ButtonGroup fileNameButtonGroup
void doFilesSetRuleDialog(FilesSet.Rule selectedRule)
javax.swing.JCheckBox ignoreKnownFilesCheckbox
javax.swing.JLabel setsListLabel
javax.swing.JCheckBox ingoreUnallocCheckbox
void newRuleButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JLabel jLabel8
FilesSetDefsPanel(PANEL_TYPE panelType)
static synchronized List< IngestProfile > getIngestProfiles()
javax.swing.JLabel jLabel3
javax.swing.JTextField daysIncludedTextField
javax.swing.JButton newRuleButton
void doFileSetsDialog(FilesSet selectedSet, boolean shouldCreateNew)
javax.swing.JLabel jLabel2
void valueChanged(ListSelectionEvent e)
void importSetButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JButton deleteSetButton
javax.swing.JRadioButton filesRadioButton
Map< String, Rule > getRules()
javax.swing.JTextArea setDescriptionTextArea
javax.swing.JButton editSetButton
final String ruleDialogTitle
javax.swing.JCheckBox rulePathConditionRegexCheckBox
javax.swing.JSeparator separator
void fileNameRegexCheckboxActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JCheckBox fileNameRegexCheckbox
void resetRuleComponents()
TreeMap< String, FilesSet > filesSets
javax.swing.JRadioButton dirsRadioButton
javax.swing.JRadioButton allRadioButton
javax.swing.JComboBox< String > equalitySignComboBox
boolean ignoresKnownFiles()
synchronized static Logger getLogger(String name)
void enableButtons(boolean isEnabled)
final PANEL_TYPE panelType
javax.swing.JButton deleteRuleButton
javax.swing.JButton editRuleButton
javax.swing.JScrollPane jScrollPane2
javax.swing.JLabel ingestWarningLabel
final String filterDialogTitle
void newSetButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JTextField rulePathConditionTextField
javax.swing.JComboBox< String > mimeTypeComboBox
boolean ingoresUnallocatedSpace()
static synchronized SortedSet< String > getDetectedTypes()
javax.swing.JRadioButton fileNameRadioButton
javax.swing.JScrollPane jScrollPane1
javax.swing.JLabel jLabel5
final DefaultListModel< FilesSet.Rule > rulesListModel
javax.swing.JList< FilesSet.Rule > rulesList
static void error(String message)
javax.swing.ButtonGroup typeButtonGroup