19 package org.sleuthkit.autopsy.modules.interestingitems;
21 import java.awt.EventQueue;
23 import java.util.ArrayList;
24 import java.util.Collection;
25 import java.util.Collections;
26 import java.util.Comparator;
27 import java.util.HashMap;
28 import java.util.List;
30 import java.util.SortedSet;
31 import java.util.TreeMap;
32 import java.util.logging.Level;
33 import javax.swing.DefaultListModel;
34 import javax.swing.JButton;
35 import javax.swing.JFileChooser;
36 import javax.swing.JOptionPane;
37 import javax.swing.event.ListSelectionEvent;
38 import javax.swing.event.ListSelectionListener;
39 import javax.swing.filechooser.FileNameExtensionFilter;
40 import org.netbeans.spi.options.OptionsPanelController;
41 import org.openide.util.NbBundle;
42 import org.openide.windows.WindowManager;
54 @SuppressWarnings(
"PMD.SingularField")
57 private static final long serialVersionUID = 1L;
59 @NbBundle.Messages({
"# {0} - filter name",
60 "# {1} - profile name",
61 "FilesSetDefsPanel.ingest.fileFilterInUseError=The selected file filter, {0}, is being used by a profile, {1}, and cannot be deleted while any profile uses it.",
62 "FilesSetDefsPanel.bytes=Bytes",
63 "FilesSetDefsPanel.kiloBytes=Kilobytes",
64 "FilesSetDefsPanel.megaBytes=Megabytes",
65 "FilesSetDefsPanel.gigaBytes=Gigabytes",
66 "FilesSetDefsPanel.loadError=Error loading interesting files sets from file.",
67 "FilesSetDefsPanel.saveError=Error saving interesting files sets to file.",
68 "FilesSetDefsPanel.interesting.copySetButton.text=Copy Set",
69 "FilesSetDefsPanel.interesting.importSetButton.text=Import Set",
70 "FilesSetDefsPanel.interesting.exportSetButton.text=Export Set"
77 private final DefaultListModel<FilesSet> setsListModel =
new DefaultListModel<>();
78 private final DefaultListModel<
FilesSet.
Rule> rulesListModel =
new DefaultListModel<>();
80 private final JButton okButton =
new JButton(
"OK");
81 private final JButton cancelButton =
new JButton(
"Cancel");
85 private boolean canBeEnabled =
true;
100 this.panelType = panelType;
101 this.initComponents();
103 this.setsList.setModel(setsListModel);
105 this.rulesList.setModel(rulesListModel);
107 this.ingestWarningLabel.setVisible(
false);
109 this.copySetButton.setVisible(
false);
110 this.importSetButton.setVisible(
false);
111 this.exportSetButton.setVisible(
false);
112 this.mimeTypeComboBox.setVisible(
false);
113 this.jLabel7.setVisible(
false);
114 this.fileSizeUnitComboBox.setVisible(
false);
115 this.fileSizeSpinner.setVisible(
false);
116 this.filterDialogTitle =
"FilesSetPanel.filter.title";
117 this.ruleDialogTitle =
"FilesSetPanel.rule.title";
118 this.jLabel8.setVisible(
false);
119 this.equalitySignComboBox.setVisible(
false);
120 this.ignoreKnownFilesCheckbox.setVisible(
false);
121 this.jLabel2.setVisible(
false);
122 this.filesRadioButton.setVisible(
false);
123 this.dirsRadioButton.setVisible(
false);
124 this.allRadioButton.setVisible(
false);
125 this.jTextArea1.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.jTextArea1.text"));
126 org.openide.awt.Mnemonics.setLocalizedText(setsListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.setsListLabel.text"));
127 org.openide.awt.Mnemonics.setLocalizedText(editSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.editSetButton.text"));
128 org.openide.awt.Mnemonics.setLocalizedText(newSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.newSetButton.text"));
129 org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.deleteSetButton.text"));
130 org.openide.awt.Mnemonics.setLocalizedText(jLabel6,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingest.jLabel6.text"));
132 this.filterDialogTitle =
"FilesSetPanel.interesting.title";
133 this.ruleDialogTitle =
"FilesSetPanel.interesting.title";
134 this.ingoreUnallocCheckbox.setVisible(
false);
138 @NbBundle.Messages({
"FilesSetDefsPanel.Interesting.Title=Global Interesting Items Settings",
139 "FilesSetDefsPanel.Ingest.Title=File Filter Settings"})
142 setName(Bundle.FilesSetDefsPanel_Ingest_Title());
144 setName(Bundle.FilesSetDefsPanel_Interesting_Title());
149 detectableMimeTypes.forEach((type) -> {
150 mimeTypeComboBox.addItem(type);
153 logger.log(Level.SEVERE,
"Unable to get detectable file types", ex);
156 this.fileSizeUnitComboBox.setSelectedIndex(1);
157 this.equalitySignComboBox.setSelectedIndex(2);
171 logger.log(Level.WARNING, Bundle.FilesSetDefsPanel_saveError(), ex);
178 canBeEnabled = isEnabled;
179 newRuleButton.setEnabled(isEnabled);
180 copySetButton.setEnabled(isEnabled && setSelected);
181 newSetButton.setEnabled(isEnabled);
182 editRuleButton.setEnabled(isEnabled && ruleSelected);
183 editSetButton.setEnabled(isEnabled && setSelected);
184 exportSetButton.setEnabled(setSelected);
185 importSetButton.setEnabled(isEnabled);
186 deleteRuleButton.setEnabled(isEnabled && ruleSelected);
187 deleteSetButton.setEnabled(isEnabled && setSelected);
188 ingestWarningLabel.setVisible(!isEnabled);
198 this.resetComponents();
211 logger.log(Level.WARNING, Bundle.FilesSetDefsPanel_loadError(), ex);
212 this.filesSets =
new TreeMap<>();
217 this.filesSets.values().forEach((set) -> {
218 this.setsListModel.addElement(set);
221 if (!this.filesSets.isEmpty()) {
224 EventQueue.invokeLater(() -> {
234 this.resetRuleComponents();
235 this.setsListModel.clear();
236 this.setDescriptionTextArea.setText(
"");
237 this.ignoreKnownFilesCheckbox.setSelected(
true);
238 this.ingoreUnallocCheckbox.setSelected(
true);
239 this.newSetButton.setEnabled(
true && canBeEnabled);
240 this.editSetButton.setEnabled(
false);
241 this.copySetButton.setEnabled(
false);
242 this.exportSetButton.setEnabled(
false);
243 this.importSetButton.setEnabled(
true && canBeEnabled);
244 this.deleteSetButton.setEnabled(
false);
252 this.fileNameTextField.setText(
"");
253 this.fileNameRadioButton.setSelected(
true);
254 this.fileNameRegexCheckbox.setSelected(
false);
255 this.filesRadioButton.setSelected(
true);
256 this.rulePathConditionTextField.setText(
"");
257 this.daysIncludedTextField.setText(
"");
258 this.rulePathConditionRegexCheckBox.setSelected(
false);
259 this.mimeTypeComboBox.setSelectedIndex(0);
260 this.equalitySignComboBox.setSelectedIndex(2);
261 this.fileSizeUnitComboBox.setSelectedIndex(1);
262 this.fileSizeSpinner.setValue(0);
263 this.newRuleButton.setEnabled(!this.setsListModel.isEmpty() && canBeEnabled);
264 this.editRuleButton.setEnabled(
false);
265 this.deleteRuleButton.setEnabled(
false);
275 if (e.getValueIsAdjusting()) {
288 if (selectedSet != null) {
301 Collections.sort(rules,
new Comparator<FilesSet.Rule>() {
304 return rule1.toString().compareTo(rule2.toString());
307 rules.forEach((rule) -> {
333 if (e.getValueIsAdjusting()) {
349 if (nameCondition != null) {
360 switch (typeCondition.getMetaType()) {
367 case FILES_AND_DIRECTORIES:
371 if (pathCondition != null) {
378 if (mimeTypeCondition != null) {
383 if (fileSizeCondition != null) {
392 if (dateCondition != null){
423 if (selectedSet != null) {
434 int option = JOptionPane.OK_OPTION;
436 option = JOptionPane.showConfirmDialog(
this, panel, NbBundle.getMessage(
FilesSetPanel.class, filterDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
437 }
while (option == JOptionPane.OK_OPTION && !panel.isValidDefinition());
441 if (this.filesSets.containsKey(panel.getFilesSetName()) && shouldCreateNew) {
443 "FilesSetDefsPanel.doFileSetsDialog.duplicateRuleSet.text",
444 panel.getFilesSetName()));
448 if (option == JOptionPane.OK_OPTION) {
450 if (selectedSet != null) {
454 rules.putAll(selectedSet.
getRules());
456 if (shouldCreateNew) {
457 this.replaceFilesSet(null, panel.getFilesSetName(), panel.getFilesSetDescription(), panel.getFileSetIgnoresKnownFiles(), panel.getFileSetIgnoresUnallocatedSpace(), rules);
459 this.replaceFilesSet(selectedSet, panel.getFilesSetName(), panel.getFilesSetDescription(), panel.getFileSetIgnoresKnownFiles(), panel.getFileSetIgnoresUnallocatedSpace(), rules);
473 FilesSetRulePanel panel;
474 if (selectedRule != null) {
476 panel =
new FilesSetRulePanel(selectedRule, okButton, cancelButton, panelType);
479 panel =
new FilesSetRulePanel(okButton, cancelButton, panelType);
484 int option = JOptionPane.OK_OPTION;
486 option = JOptionPane.showOptionDialog(
this, panel, NbBundle.getMessage(
FilesSetPanel.class, ruleDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null,
new Object[]{okButton, cancelButton}, okButton);
488 }
while (option == JOptionPane.OK_OPTION && !panel.isValidRuleDefinition());
490 if (option == JOptionPane.OK_OPTION) {
494 FilesSet selectedSet = this.setsList.getSelectedValue();
499 if (selectedRule != null) {
500 rules.remove(selectedRule.getUuid());
502 FilesSet.
Rule newRule =
new FilesSet.
Rule(panel.getRuleName(), panel.getFileNameCondition(), panel.getMetaTypeCondition(), panel.getPathCondition(), panel.getMimeTypeCondition(), panel.getFileSizeCondition(), panel.getDateCondition());
503 rules.put(newRule.getUuid(), newRule);
512 EventQueue.invokeLater(() -> {
513 this.rulesList.setSelectedValue(newRule,
true);
533 void replaceFilesSet(
FilesSet oldSet, String name, String description,
boolean ignoresKnownFiles,
boolean ignoresUnallocatedSpace, Map<String, FilesSet.Rule> rules) {
534 if (oldSet != null) {
537 this.filesSets.remove(oldSet.
getName());
542 FilesSet newSet =
new FilesSet(name, description, ignoresKnownFiles, ignoresUnallocatedSpace, rules);
543 this.filesSets.put(newSet.getName(), newSet);
547 FilesSetDefsPanel.this.setsListModel.clear();
548 this.filesSets.values().forEach((set) -> {
549 this.setsListModel.addElement(set);
555 this.setsList.setSelectedValue(newSet,
true);
563 @SuppressWarnings(
"unchecked")
565 private
void initComponents() {
567 fileNameButtonGroup =
new javax.swing.ButtonGroup();
568 typeButtonGroup =
new javax.swing.ButtonGroup();
569 jScrollPane1 =
new javax.swing.JScrollPane();
570 jPanel1 =
new javax.swing.JPanel();
571 jLabel6 =
new javax.swing.JLabel();
572 newRuleButton =
new javax.swing.JButton();
573 filesRadioButton =
new javax.swing.JRadioButton();
574 editRuleButton =
new javax.swing.JButton();
575 rulesListLabel =
new javax.swing.JLabel();
576 rulesListScrollPane =
new javax.swing.JScrollPane();
577 rulesList =
new javax.swing.JList<>();
578 setDescScrollPanel =
new javax.swing.JScrollPane();
579 setDescriptionTextArea =
new javax.swing.JTextArea();
580 editSetButton =
new javax.swing.JButton();
581 setsListScrollPane =
new javax.swing.JScrollPane();
582 setsList =
new javax.swing.JList<>();
583 fileNameExtensionRadioButton =
new javax.swing.JRadioButton();
584 jLabel3 =
new javax.swing.JLabel();
585 fileNameTextField =
new javax.swing.JTextField();
586 jLabel5 =
new javax.swing.JLabel();
587 fileNameRadioButton =
new javax.swing.JRadioButton();
588 rulePathConditionTextField =
new javax.swing.JTextField();
589 ignoreKnownFilesCheckbox =
new javax.swing.JCheckBox();
590 fileNameRegexCheckbox =
new javax.swing.JCheckBox();
591 separator =
new javax.swing.JSeparator();
592 setsListLabel =
new javax.swing.JLabel();
593 allRadioButton =
new javax.swing.JRadioButton();
594 deleteSetButton =
new javax.swing.JButton();
595 deleteRuleButton =
new javax.swing.JButton();
596 newSetButton =
new javax.swing.JButton();
597 jLabel2 =
new javax.swing.JLabel();
598 dirsRadioButton =
new javax.swing.JRadioButton();
599 jLabel1 =
new javax.swing.JLabel();
600 jLabel4 =
new javax.swing.JLabel();
601 rulePathConditionRegexCheckBox =
new javax.swing.JCheckBox();
602 jScrollPane2 =
new javax.swing.JScrollPane();
603 jTextArea1 =
new javax.swing.JTextArea();
604 jLabel7 =
new javax.swing.JLabel();
605 mimeTypeComboBox =
new javax.swing.JComboBox<>();
606 jLabel8 =
new javax.swing.JLabel();
607 equalitySignComboBox =
new javax.swing.JComboBox<String>();
608 fileSizeSpinner =
new javax.swing.JSpinner();
609 fileSizeUnitComboBox =
new javax.swing.JComboBox<String>();
610 ingoreUnallocCheckbox =
new javax.swing.JCheckBox();
611 ingestWarningLabel =
new javax.swing.JLabel();
612 copySetButton =
new javax.swing.JButton();
613 importSetButton =
new javax.swing.JButton();
614 exportSetButton =
new javax.swing.JButton();
615 modifiedDateLabel =
new javax.swing.JLabel();
616 daysIncludedTextField =
new javax.swing.JTextField();
617 daysIncludedLabel =
new javax.swing.JLabel();
619 setFont(getFont().deriveFont(getFont().getStyle() & ~java.awt.Font.BOLD, 11));
621 jScrollPane1.setFont(jScrollPane1.getFont().deriveFont(jScrollPane1.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
623 jPanel1.setFont(jPanel1.getFont().deriveFont(jPanel1.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
625 jLabel6.setFont(jLabel6.getFont().deriveFont(jLabel6.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
626 org.openide.awt.Mnemonics.setLocalizedText(jLabel6,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.jLabel6.text"));
628 newRuleButton.setFont(newRuleButton.getFont().deriveFont(newRuleButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
629 newRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
630 org.openide.awt.Mnemonics.setLocalizedText(newRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.newRuleButton.text"));
631 newRuleButton.addActionListener(
new java.awt.event.ActionListener() {
632 public void actionPerformed(java.awt.event.ActionEvent evt) {
633 newRuleButtonActionPerformed(evt);
637 typeButtonGroup.add(filesRadioButton);
638 filesRadioButton.setFont(filesRadioButton.getFont().deriveFont(filesRadioButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
639 filesRadioButton.setSelected(
true);
640 org.openide.awt.Mnemonics.setLocalizedText(filesRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.filesRadioButton.text"));
641 filesRadioButton.setEnabled(
false);
643 editRuleButton.setFont(editRuleButton.getFont().deriveFont(editRuleButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
644 editRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/edit16.png")));
645 org.openide.awt.Mnemonics.setLocalizedText(editRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.editRuleButton.text"));
646 editRuleButton.setEnabled(
false);
647 editRuleButton.addActionListener(
new java.awt.event.ActionListener() {
648 public void actionPerformed(java.awt.event.ActionEvent evt) {
649 editRuleButtonActionPerformed(evt);
653 rulesListLabel.setFont(rulesListLabel.getFont().deriveFont(rulesListLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
654 org.openide.awt.Mnemonics.setLocalizedText(rulesListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulesListLabel.text"));
656 rulesListScrollPane.setFont(rulesListScrollPane.getFont().deriveFont(rulesListScrollPane.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
658 rulesList.setFont(rulesList.getFont().deriveFont(rulesList.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
659 rulesList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
660 rulesListScrollPane.setViewportView(rulesList);
662 setDescScrollPanel.setFont(setDescScrollPanel.getFont().deriveFont(setDescScrollPanel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
663 setDescScrollPanel.setMinimumSize(
new java.awt.Dimension(10, 22));
664 setDescScrollPanel.setPreferredSize(
new java.awt.Dimension(14, 40));
666 setDescriptionTextArea.setEditable(
false);
667 setDescriptionTextArea.setBackground(
new java.awt.Color(240, 240, 240));
668 setDescriptionTextArea.setColumns(20);
669 setDescriptionTextArea.setFont(setDescriptionTextArea.getFont().deriveFont(setDescriptionTextArea.getFont().getStyle() & ~java.awt.Font.BOLD, 13));
670 setDescriptionTextArea.setLineWrap(
true);
671 setDescriptionTextArea.setRows(6);
672 setDescriptionTextArea.setMinimumSize(
new java.awt.Dimension(10, 22));
673 setDescriptionTextArea.setOpaque(
false);
674 setDescScrollPanel.setViewportView(setDescriptionTextArea);
676 editSetButton.setFont(editSetButton.getFont().deriveFont(editSetButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
677 editSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/edit16.png")));
678 org.openide.awt.Mnemonics.setLocalizedText(editSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.editSetButton.text"));
679 editSetButton.setEnabled(
false);
680 editSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
681 editSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
682 editSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
683 editSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
684 editSetButton.addActionListener(
new java.awt.event.ActionListener() {
685 public void actionPerformed(java.awt.event.ActionEvent evt) {
686 editSetButtonActionPerformed(evt);
690 setsListScrollPane.setFont(setsListScrollPane.getFont().deriveFont(setsListScrollPane.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
692 setsList.setFont(setsList.getFont().deriveFont(setsList.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
693 setsList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
694 setsListScrollPane.setViewportView(setsList);
696 fileNameButtonGroup.add(fileNameExtensionRadioButton);
697 fileNameExtensionRadioButton.setFont(fileNameExtensionRadioButton.getFont().deriveFont(fileNameExtensionRadioButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
698 org.openide.awt.Mnemonics.setLocalizedText(fileNameExtensionRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameExtensionRadioButton.text"));
699 fileNameExtensionRadioButton.setEnabled(
false);
701 jLabel3.setFont(jLabel3.getFont().deriveFont(jLabel3.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
702 org.openide.awt.Mnemonics.setLocalizedText(jLabel3,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.jLabel3.text"));
704 fileNameTextField.setEditable(
false);
705 fileNameTextField.setFont(fileNameTextField.getFont().deriveFont(fileNameTextField.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
706 fileNameTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameTextField.text"));
708 jLabel5.setFont(jLabel5.getFont().deriveFont(jLabel5.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
709 org.openide.awt.Mnemonics.setLocalizedText(jLabel5,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.jLabel5.text"));
711 fileNameButtonGroup.add(fileNameRadioButton);
712 fileNameRadioButton.setFont(fileNameRadioButton.getFont().deriveFont(fileNameRadioButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
713 org.openide.awt.Mnemonics.setLocalizedText(fileNameRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.fileNameRadioButton.text"));
714 fileNameRadioButton.setEnabled(
false);
716 rulePathConditionTextField.setEditable(
false);
717 rulePathConditionTextField.setFont(rulePathConditionTextField.getFont().deriveFont(rulePathConditionTextField.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
718 rulePathConditionTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulePathConditionTextField.text"));
720 ignoreKnownFilesCheckbox.setFont(ignoreKnownFilesCheckbox.getFont().deriveFont(ignoreKnownFilesCheckbox.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
721 org.openide.awt.Mnemonics.setLocalizedText(ignoreKnownFilesCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ignoreKnownFilesCheckbox.text"));
722 ignoreKnownFilesCheckbox.setEnabled(
false);
724 fileNameRegexCheckbox.setFont(fileNameRegexCheckbox.getFont().deriveFont(fileNameRegexCheckbox.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
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 setsListLabel.setFont(setsListLabel.getFont().deriveFont(setsListLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
736 org.openide.awt.Mnemonics.setLocalizedText(setsListLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.setsListLabel.text"));
738 typeButtonGroup.add(allRadioButton);
739 allRadioButton.setFont(allRadioButton.getFont().deriveFont(allRadioButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
740 org.openide.awt.Mnemonics.setLocalizedText(allRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.allRadioButton.text"));
741 allRadioButton.setEnabled(
false);
743 deleteSetButton.setFont(deleteSetButton.getFont().deriveFont(deleteSetButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
744 deleteSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
745 org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.deleteSetButton.text"));
746 deleteSetButton.setEnabled(
false);
747 deleteSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
748 deleteSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
749 deleteSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
750 deleteSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
751 deleteSetButton.addActionListener(
new java.awt.event.ActionListener() {
752 public void actionPerformed(java.awt.event.ActionEvent evt) {
753 deleteSetButtonActionPerformed(evt);
757 deleteRuleButton.setFont(deleteRuleButton.getFont().deriveFont(deleteRuleButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
758 deleteRuleButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
759 org.openide.awt.Mnemonics.setLocalizedText(deleteRuleButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.deleteRuleButton.text"));
760 deleteRuleButton.setEnabled(
false);
761 deleteRuleButton.addActionListener(
new java.awt.event.ActionListener() {
762 public void actionPerformed(java.awt.event.ActionEvent evt) {
763 deleteRuleButtonActionPerformed(evt);
767 newSetButton.setFont(newSetButton.getFont().deriveFont(newSetButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
768 newSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
769 org.openide.awt.Mnemonics.setLocalizedText(newSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.newSetButton.text"));
770 newSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
771 newSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
772 newSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
773 newSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
774 newSetButton.addActionListener(
new java.awt.event.ActionListener() {
775 public void actionPerformed(java.awt.event.ActionEvent evt) {
776 newSetButtonActionPerformed(evt);
780 jLabel2.setFont(jLabel2.getFont().deriveFont(jLabel2.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
781 org.openide.awt.Mnemonics.setLocalizedText(jLabel2,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.jLabel2.text"));
783 typeButtonGroup.add(dirsRadioButton);
784 dirsRadioButton.setFont(dirsRadioButton.getFont().deriveFont(dirsRadioButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
785 org.openide.awt.Mnemonics.setLocalizedText(dirsRadioButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.dirsRadioButton.text"));
786 dirsRadioButton.setEnabled(
false);
788 jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
789 org.openide.awt.Mnemonics.setLocalizedText(jLabel1,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.jLabel1.text"));
791 jLabel4.setFont(jLabel4.getFont().deriveFont(jLabel4.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
792 org.openide.awt.Mnemonics.setLocalizedText(jLabel4,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.jLabel4.text"));
794 rulePathConditionRegexCheckBox.setFont(rulePathConditionRegexCheckBox.getFont().deriveFont(rulePathConditionRegexCheckBox.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
795 org.openide.awt.Mnemonics.setLocalizedText(rulePathConditionRegexCheckBox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.rulePathConditionRegexCheckBox.text"));
796 rulePathConditionRegexCheckBox.setEnabled(
false);
798 jScrollPane2.setFont(jScrollPane2.getFont().deriveFont(jScrollPane2.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
800 jTextArea1.setEditable(
false);
801 jTextArea1.setBackground(
new java.awt.Color(240, 240, 240));
802 jTextArea1.setColumns(20);
803 jTextArea1.setFont(jTextArea1.getFont().deriveFont(jTextArea1.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
804 jTextArea1.setLineWrap(
true);
805 jTextArea1.setRows(3);
806 jTextArea1.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.jTextArea1.text"));
807 jTextArea1.setWrapStyleWord(
true);
808 jTextArea1.setOpaque(
false);
809 jScrollPane2.setViewportView(jTextArea1);
811 org.openide.awt.Mnemonics.setLocalizedText(jLabel7,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.jLabel7.text"));
813 mimeTypeComboBox.setBackground(
new java.awt.Color(240, 240, 240));
814 mimeTypeComboBox.setEditable(
true);
815 mimeTypeComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] {
""}));
816 mimeTypeComboBox.setEnabled(
false);
817 mimeTypeComboBox.setMinimumSize(
new java.awt.Dimension(0, 20));
818 mimeTypeComboBox.setPreferredSize(
new java.awt.Dimension(12, 20));
820 org.openide.awt.Mnemonics.setLocalizedText(jLabel8,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.jLabel8.text"));
822 equalitySignComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] {
"=",
">",
"≥",
"<",
"≤" }));
823 equalitySignComboBox.setEnabled(
false);
825 fileSizeSpinner.setEnabled(
false);
826 fileSizeSpinner.setMinimumSize(
new java.awt.Dimension(2, 20));
828 fileSizeUnitComboBox.setModel(
new javax.swing.DefaultComboBoxModel<String>(
new String[] { Bundle.FilesSetDefsPanel_bytes(), Bundle.FilesSetDefsPanel_kiloBytes(), Bundle.FilesSetDefsPanel_megaBytes(), Bundle.FilesSetDefsPanel_gigaBytes() }));
829 fileSizeUnitComboBox.setEnabled(
false);
831 org.openide.awt.Mnemonics.setLocalizedText(ingoreUnallocCheckbox,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingoreUnallocCheckbox.text"));
832 ingoreUnallocCheckbox.setToolTipText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingoreUnallocCheckbox.toolTipText"));
833 ingoreUnallocCheckbox.setEnabled(
false);
835 ingestWarningLabel.setFont(ingestWarningLabel.getFont().deriveFont(ingestWarningLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
836 ingestWarningLabel.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png")));
837 org.openide.awt.Mnemonics.setLocalizedText(ingestWarningLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.ingestWarningLabel.text"));
839 copySetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/new16.png")));
840 org.openide.awt.Mnemonics.setLocalizedText(copySetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.copySetButton.text"));
841 copySetButton.setEnabled(
false);
842 copySetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
843 copySetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
844 copySetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
845 copySetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
846 copySetButton.addActionListener(
new java.awt.event.ActionListener() {
847 public void actionPerformed(java.awt.event.ActionEvent evt) {
848 copySetButtonActionPerformed(evt);
852 importSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/import16.png")));
853 org.openide.awt.Mnemonics.setLocalizedText(importSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.importSetButton.text"));
854 importSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
855 importSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
856 importSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
857 importSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
858 importSetButton.addActionListener(
new java.awt.event.ActionListener() {
859 public void actionPerformed(java.awt.event.ActionEvent evt) {
860 importSetButtonActionPerformed(evt);
864 exportSetButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/export16.png")));
865 org.openide.awt.Mnemonics.setLocalizedText(exportSetButton,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.interesting.exportSetButton.text"));
866 exportSetButton.setEnabled(
false);
867 exportSetButton.setMargin(
new java.awt.Insets(2, 6, 2, 6));
868 exportSetButton.setMaximumSize(
new java.awt.Dimension(111, 25));
869 exportSetButton.setMinimumSize(
new java.awt.Dimension(111, 25));
870 exportSetButton.setPreferredSize(
new java.awt.Dimension(111, 25));
871 exportSetButton.addActionListener(
new java.awt.event.ActionListener() {
872 public void actionPerformed(java.awt.event.ActionEvent evt) {
873 exportSetButtonActionPerformed(evt);
877 org.openide.awt.Mnemonics.setLocalizedText(modifiedDateLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.modifiedDateLabel.text"));
879 daysIncludedTextField.setEditable(
false);
880 daysIncludedTextField.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
881 daysIncludedTextField.setText(
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.daysIncludedTextField.text"));
882 daysIncludedTextField.setMinimumSize(
new java.awt.Dimension(60, 20));
883 daysIncludedTextField.setPreferredSize(
new java.awt.Dimension(60, 20));
885 org.openide.awt.Mnemonics.setLocalizedText(daysIncludedLabel,
org.openide.util.NbBundle.getMessage(
FilesSetDefsPanel.class,
"FilesSetDefsPanel.daysIncludedLabel.text"));
886 daysIncludedLabel.setEnabled(
false);
888 javax.swing.GroupLayout jPanel1Layout =
new javax.swing.GroupLayout(jPanel1);
889 jPanel1.setLayout(jPanel1Layout);
890 jPanel1Layout.setHorizontalGroup(
891 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
892 .addGroup(jPanel1Layout.createSequentialGroup()
894 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
895 .addGroup(jPanel1Layout.createSequentialGroup()
896 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
false)
897 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
898 .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
899 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
900 .addComponent(importSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
901 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
902 .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
903 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
904 .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
905 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
906 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
907 .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
908 .addComponent(deleteSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
909 .addComponent(setsListScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
910 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
911 .addComponent(setsListLabel))
912 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
913 .addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
914 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
915 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
916 .addGroup(jPanel1Layout.createSequentialGroup()
917 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
918 .addComponent(rulesListScrollPane, javax.swing.GroupLayout.Alignment.TRAILING)
919 .addComponent(setDescScrollPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
920 .addGroup(jPanel1Layout.createSequentialGroup()
922 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
923 .addComponent(jLabel7)
924 .addComponent(jLabel8)
925 .addComponent(jLabel2)
926 .addComponent(jLabel4)
927 .addComponent(modifiedDateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
928 .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
929 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
930 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
931 .addComponent(rulePathConditionTextField)
932 .addComponent(fileNameTextField, javax.swing.GroupLayout.Alignment.TRAILING)
933 .addComponent(mimeTypeComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
934 .addGroup(jPanel1Layout.createSequentialGroup()
935 .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
936 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
937 .addComponent(fileSizeSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
938 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
939 .addComponent(fileSizeUnitComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
940 .addGroup(jPanel1Layout.createSequentialGroup()
941 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
942 .addComponent(rulePathConditionRegexCheckBox)
943 .addGroup(jPanel1Layout.createSequentialGroup()
944 .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
945 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
946 .addComponent(daysIncludedLabel))
947 .addGroup(jPanel1Layout.createSequentialGroup()
948 .addComponent(filesRadioButton)
949 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
950 .addComponent(dirsRadioButton)
951 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
952 .addComponent(allRadioButton))
953 .addGroup(jPanel1Layout.createSequentialGroup()
954 .addComponent(fileNameRadioButton)
955 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
956 .addComponent(fileNameExtensionRadioButton)
957 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
958 .addComponent(fileNameRegexCheckbox)))
959 .addGap(0, 0, Short.MAX_VALUE)))))
961 .addGroup(jPanel1Layout.createSequentialGroup()
962 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
963 .addComponent(rulesListLabel)
964 .addGroup(jPanel1Layout.createSequentialGroup()
965 .addComponent(ignoreKnownFilesCheckbox)
966 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
967 .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
968 .addGroup(jPanel1Layout.createSequentialGroup()
969 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
970 .addComponent(jLabel5)
971 .addComponent(jLabel6))
972 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
973 .addComponent(ingestWarningLabel))
974 .addComponent(jLabel1)
975 .addGroup(jPanel1Layout.createSequentialGroup()
976 .addComponent(newRuleButton)
978 .addComponent(editRuleButton)
980 .addComponent(deleteRuleButton)))
981 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
984 jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {copySetButton, deleteSetButton, editSetButton, exportSetButton, importSetButton, newSetButton});
986 jPanel1Layout.setVerticalGroup(
987 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
988 .addGroup(jPanel1Layout.createSequentialGroup()
990 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
991 .addComponent(separator)
992 .addGroup(jPanel1Layout.createSequentialGroup()
993 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
994 .addGroup(jPanel1Layout.createSequentialGroup()
995 .addComponent(jLabel6)
996 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
997 .addComponent(jLabel5)
999 .addComponent(ingestWarningLabel, javax.swing.GroupLayout.Alignment.TRAILING))
1000 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1001 .addComponent(setDescScrollPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
1002 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1003 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1004 .addComponent(ignoreKnownFilesCheckbox)
1005 .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
1006 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
1007 .addComponent(rulesListLabel)
1008 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1009 .addComponent(rulesListScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE)
1010 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1011 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1012 .addComponent(newRuleButton)
1013 .addComponent(editRuleButton)
1014 .addComponent(deleteRuleButton))
1015 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1016 .addComponent(jLabel1)
1017 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1018 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1019 .addComponent(jLabel2)
1020 .addComponent(filesRadioButton)
1021 .addComponent(dirsRadioButton)
1022 .addComponent(allRadioButton))
1023 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1024 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1025 .addComponent(jLabel3)
1026 .addComponent(fileNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
1027 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1028 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1029 .addComponent(fileNameRadioButton)
1030 .addComponent(fileNameExtensionRadioButton)
1031 .addComponent(fileNameRegexCheckbox))
1032 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1033 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1034 .addComponent(jLabel4)
1035 .addComponent(rulePathConditionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
1036 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1037 .addComponent(rulePathConditionRegexCheckBox)
1038 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1039 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1040 .addComponent(jLabel7)
1041 .addComponent(mimeTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1042 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1043 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1044 .addComponent(jLabel8)
1045 .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1046 .addComponent(fileSizeSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1047 .addComponent(fileSizeUnitComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1048 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1049 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1050 .addComponent(modifiedDateLabel)
1051 .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1052 .addComponent(daysIncludedLabel))
1054 .addGroup(jPanel1Layout.createSequentialGroup()
1055 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1056 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1057 .addComponent(setsListLabel)
1058 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1059 .addComponent(setsListScrollPane)
1060 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1061 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1062 .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1063 .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1064 .addComponent(deleteSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1065 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1066 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1067 .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1068 .addComponent(importSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1069 .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1073 jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL,
new java.awt.Component[] {copySetButton, deleteRuleButton, deleteSetButton, editRuleButton, editSetButton, exportSetButton, importSetButton, newRuleButton, newSetButton});
1075 jScrollPane1.setViewportView(jPanel1);
1077 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
1078 this.setLayout(layout);
1079 layout.setHorizontalGroup(
1080 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1081 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE)
1083 layout.setVerticalGroup(
1084 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1085 .addComponent(jScrollPane1)
1090 this.doFileSetsDialog(null,
true);
1091 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1099 FilesSet oldSet = this.setsList.getSelectedValue();
1101 FilesSet.
Rule selectedRule = this.rulesList.getSelectedValue();
1102 rules.remove(selectedRule.getUuid());
1104 if (!this.rulesListModel.isEmpty()) {
1105 this.rulesList.setSelectedIndex(0);
1107 this.resetRuleComponents();
1109 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1113 FilesSet selectedSet = this.setsList.getSelectedValue();
1116 if (profile.getFileIngestFilter().equals(selectedSet.
getName())) {
1118 "FilesSetDefsPanel.ingest.fileFilterInUseError",
1119 selectedSet.
getName(), profile.toString()));
1125 this.filesSets.remove(selectedSet.
getName());
1126 this.setsListModel.removeElement(selectedSet);
1129 if (!this.filesSets.isEmpty()) {
1130 this.setsList.setSelectedIndex(0);
1132 this.resetComponents();
1134 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1138 this.doFileSetsDialog(this.setsList.getSelectedValue(),
false);
1139 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1143 this.doFilesSetRuleDialog(this.rulesList.getSelectedValue());
1144 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1148 this.doFilesSetRuleDialog(null);
1149 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1153 this.doFileSetsDialog(this.setsList.getSelectedValue(),
true);
1154 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1156 @NbBundle.Messages({
1157 "FilesSetDefsPanel.yesOwMsg=Yes, overwrite",
1158 "FilesSetDefsPanel.noSkipMsg=No, skip",
1159 "FilesSetDefsPanel.cancelImportMsg=Cancel import",
1160 "# {0} - FilesSet name",
1161 "FilesSetDefsPanel.interesting.overwriteSetPrompt=Interesting files set <{0}> already exists locally, overwrite?",
1162 "FilesSetDefsPanel.interesting.importOwConflict=Import Interesting files set conflict",
1163 "FilesSetDefsPanel.interesting.failImportMsg=Interesting files set not imported",
1164 "FilesSetDefsPanel.interesting.fileExtensionFilterLbl=Autopsy Interesting File Set File (xml)",
1165 "FilesSetDefsPanel.interesting.importButtonAction.featureName=Interesting Files Set Import"
1169 FilesSet selectedSet = this.setsList.getSelectedValue();
1170 JFileChooser chooser =
new JFileChooser();
1171 final String EXTENSION =
"xml";
1172 FileNameExtensionFilter autopsyFilter =
new FileNameExtensionFilter(
1173 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.fileExtensionFilterLbl"), EXTENSION);
1174 chooser.addChoosableFileFilter(autopsyFilter);
1175 chooser.setAcceptAllFileFilterUsed(
false);
1176 chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
1177 int returnVal = chooser.showOpenDialog(
this);
1178 if (returnVal == JFileChooser.APPROVE_OPTION) {
1179 File selFile = chooser.getSelectedFile();
1180 if (selFile == null) {
1181 JOptionPane.showMessageDialog(
this,
1182 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.failImportMsg"),
1183 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.importButtonAction.featureName"),
1184 JOptionPane.WARNING_MESSAGE);
1185 logger.warning(
"Selected file was null, when trying to import interesting files set definitions");
1188 Collection<FilesSet> importedSets;
1190 importedSets = InterestingItemsFilesSetSettings.readDefinitionsXML(selFile).values();
1191 if (importedSets.isEmpty()) {
1195 JOptionPane.showMessageDialog(
this,
1196 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.failImportMsg"),
1197 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.importButtonAction.featureName"),
1198 JOptionPane.WARNING_MESSAGE);
1199 logger.log(Level.WARNING,
"No Interesting files set definitions were read from the selected file, exception", ex);
1202 for (
FilesSet set : importedSets) {
1203 int choice = JOptionPane.OK_OPTION;
1204 if (filesSets.containsKey(set.getName())) {
1205 Object[] options = {NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.yesOwMsg"),
1206 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.noSkipMsg"),
1207 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.cancelImportMsg")};
1208 choice = JOptionPane.showOptionDialog(
this,
1209 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.overwriteSetPrompt", set.getName()),
1210 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.importOwConflict"),
1211 JOptionPane.YES_NO_CANCEL_OPTION,
1212 JOptionPane.QUESTION_MESSAGE,
1217 if (choice == JOptionPane.OK_OPTION) {
1219 this.filesSets.put(set.getName(), set);
1220 }
else if (choice == JOptionPane.CANCEL_OPTION) {
1226 this.filesSets.values().forEach((set) -> {
1227 this.setsListModel.addElement(set);
1232 this.setsList.setSelectedValue(selectedSet,
true);
1233 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1238 @NbBundle.Messages({
"FilesSetDefsPanel.interesting.exportButtonAction.featureName=Interesting Files Set Export",
1239 "# {0} - file name",
1240 "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt=File {0} exists, overwrite?",
1241 "FilesSetDefsPanel.interesting.ExportedMsg=Interesting files set exported",
1242 "FilesSetDefsPanel.interesting.failExportMsg=Export of interesting files set failed"})
1246 JFileChooser chooser =
new JFileChooser();
1247 final String EXTENSION =
"xml";
1248 FileNameExtensionFilter autopsyFilter =
new FileNameExtensionFilter(
1249 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.fileExtensionFilterLbl"), EXTENSION);
1250 chooser.addChoosableFileFilter(autopsyFilter);
1251 chooser.setSelectedFile(
new File(this.setsList.getSelectedValue().getName()));
1252 chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
1253 int returnVal = chooser.showSaveDialog(
this);
1254 if (returnVal == JFileChooser.APPROVE_OPTION) {
1255 final String FEATURE_NAME = NbBundle.getMessage(this.getClass(),
1256 "FilesSetDefsPanel.interesting.exportButtonAction.featureName");
1257 File selFile = chooser.getSelectedFile();
1258 if (selFile == null) {
1259 JOptionPane.showMessageDialog(
this,
1260 NbBundle.getMessage(
this.getClass(),
"FilesSetDefsPanel.interesting.failExportMsg"),
1262 JOptionPane.WARNING_MESSAGE);
1263 logger.warning(
"Selected file was null, when trying to export interesting files set definitions");
1267 String fileAbs = selFile.getAbsolutePath();
1268 if (!fileAbs.endsWith(
"." + EXTENSION)) {
1269 fileAbs = fileAbs +
"." + EXTENSION;
1270 selFile =
new File(fileAbs);
1272 if (selFile.exists()) {
1274 final String FILE_EXISTS_MESSAGE = NbBundle.getMessage(this.getClass(),
1275 "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt", selFile.getName());
1276 boolean shouldWrite = JOptionPane.showConfirmDialog(
this, FILE_EXISTS_MESSAGE, FEATURE_NAME, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION;
1281 List<FilesSet> exportSets;
1282 exportSets =
new ArrayList<>();
1284 exportSets.add(this.setsList.getSelectedValue());
1285 boolean written = InterestingItemsFilesSetSettings.exportXmlDefinitionsFile(selFile, exportSets);
1287 JOptionPane.showMessageDialog(
1288 WindowManager.getDefault().getMainWindow(),
1289 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.interesting.ExportedMsg"),
1291 JOptionPane.INFORMATION_MESSAGE);
1293 JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
1294 NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.interesting.failExportMsg"),
1296 JOptionPane.WARNING_MESSAGE);
1297 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