Autopsy  4.5.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
FilesSetDefsPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2018 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.modules.interestingitems;
20 
21 import java.awt.EventQueue;
22 import java.io.File;
23 import java.util.ArrayList;
24 import java.util.Collection;
25 import java.util.HashMap;
26 import java.util.List;
27 import java.util.Map;
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;
48 
52 public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel implements OptionsPanel {
53 
54  private static final long serialVersionUID = 1L;
55 
56  @NbBundle.Messages({"# {0} - filter name",
57  "# {1} - profile name",
58  "FilesSetDefsPanel.ingest.fileFilterInUseError=The selected file filter, {0}, is being used by a profile, {1}, and cannot be deleted while any profile uses it.",
59  "FilesSetDefsPanel.bytes=Bytes",
60  "FilesSetDefsPanel.kiloBytes=Kilobytes",
61  "FilesSetDefsPanel.megaBytes=Megabytes",
62  "FilesSetDefsPanel.gigaBytes=Gigabytes",
63  "FilesSetDefsPanel.loadError=Error loading interesting files sets from file.",
64  "FilesSetDefsPanel.saveError=Error saving interesting files sets to file.",
65  "FilesSetDefsPanel.interesting.copySetButton.text=Copy Set",
66  "FilesSetDefsPanel.interesting.importSetButton.text=Import Set",
67  "FilesSetDefsPanel.interesting.exportSetButton.text=Export Set"
68  })
69  public static enum PANEL_TYPE {
71  INTERESTING_FILE_SETS
72 
73  }
74  private final DefaultListModel<FilesSet> setsListModel = new DefaultListModel<>();
75  private final DefaultListModel<FilesSet.Rule> rulesListModel = new DefaultListModel<>();
76  private final Logger logger = Logger.getLogger(FilesSetDefsPanel.class.getName());
77  private final JButton okButton = new JButton("OK");
78  private final JButton cancelButton = new JButton("Cancel");
79  private final PANEL_TYPE panelType;
80  private final String filterDialogTitle;
81  private final String ruleDialogTitle;
82  private boolean canBeEnabled = true;
83 
84  // The following is a map of interesting files set names to interesting
85  // files set definitions. It is a snapshot of the files set definitions
86  // obtained from the interesting item definitions manager at the time the
87  // the panel is loaded. When the panel saves or stores its settings, these
88  // definitions, possibly changed, are submitted back to the interesting item
89  // definitions manager. Note that it is a tree map to aid in displaying
90  // files sets in sorted order by name.
91  private TreeMap<String, FilesSet> filesSets;
92 
96  public FilesSetDefsPanel(PANEL_TYPE panelType) {
97  this.panelType = panelType;
98  this.initComponents();
99  this.customInit();
100  this.setsList.setModel(setsListModel);
101  this.setsList.addListSelectionListener(new FilesSetDefsPanel.SetsListSelectionListener());
102  this.rulesList.setModel(rulesListModel);
103  this.rulesList.addListSelectionListener(new FilesSetDefsPanel.RulesListSelectionListener());
104  this.ingestWarningLabel.setVisible(false);
105  if (panelType == PANEL_TYPE.FILE_INGEST_FILTERS) { //Hide the mimetype settings when this is displaying FileSet rules instead of interesting item rules
106  this.copySetButton.setVisible(false);
107  this.importSetButton.setVisible(false);
108  this.exportSetButton.setVisible(false);
109  this.mimeTypeComboBox.setVisible(false);
110  this.jLabel7.setVisible(false);
111  this.fileSizeUnitComboBox.setVisible(false);
112  this.fileSizeSpinner.setVisible(false);
113  this.filterDialogTitle = "FilesSetPanel.filter.title";
114  this.ruleDialogTitle = "FilesSetPanel.rule.title";
115  this.jLabel8.setVisible(false);
116  this.equalitySignComboBox.setVisible(false);
117  this.ignoreKnownFilesCheckbox.setVisible(false);
118  this.jLabel2.setVisible(false);
119  this.filesRadioButton.setVisible(false);
120  this.dirsRadioButton.setVisible(false);
121  this.allRadioButton.setVisible(false);
122  this.jTextArea1.setText(org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.ingest.jTextArea1.text")); // NOI18N
123  org.openide.awt.Mnemonics.setLocalizedText(setsListLabel, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.ingest.setsListLabel.text")); // NOI18N
124  org.openide.awt.Mnemonics.setLocalizedText(editSetButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.ingest.editSetButton.text")); // NOI18N
125  org.openide.awt.Mnemonics.setLocalizedText(newSetButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.ingest.newSetButton.text")); // NOI18N
126  org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.ingest.deleteSetButton.text")); // NOI18N
127  org.openide.awt.Mnemonics.setLocalizedText(jLabel6, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.ingest.jLabel6.text")); // NOI18N
128  } else {
129  this.filterDialogTitle = "FilesSetPanel.interesting.title";
130  this.ruleDialogTitle = "FilesSetPanel.interesting.title";
131  this.ingoreUnallocCheckbox.setVisible(false);
132  }
133  }
134 
135  @NbBundle.Messages({"FilesSetDefsPanel.Interesting.Title=Global Interesting Items Settings",
136  "FilesSetDefsPanel.Ingest.Title=File Filter Settings"})
137  private void customInit() {
138  if (panelType == PANEL_TYPE.FILE_INGEST_FILTERS) {
139  setName(Bundle.FilesSetDefsPanel_Ingest_Title());
140  } else {
141  setName(Bundle.FilesSetDefsPanel_Interesting_Title());
142  }
143 
144  try {
145  SortedSet<String> detectableMimeTypes = FileTypeDetector.getDetectedTypes();
146  detectableMimeTypes.forEach((type) -> {
147  mimeTypeComboBox.addItem(type);
148  });
150  logger.log(Level.SEVERE, "Unable to get detectable file types", ex);
151  }
152 
153  this.fileSizeUnitComboBox.setSelectedIndex(1);
154  this.equalitySignComboBox.setSelectedIndex(2);
155  }
156 
157  @Override
158  public void saveSettings() {
159  try {
160  if (panelType == PANEL_TYPE.FILE_INGEST_FILTERS) {
161  FilesSetsManager.getInstance().setCustomFileIngestFilters(this.filesSets);
162  } else {
163  FilesSetsManager.getInstance().setInterestingFilesSets(this.filesSets);
164  }
165 
167  MessageNotifyUtil.Message.error(Bundle.FilesSetDefsPanel_saveError());
168  logger.log(Level.WARNING, Bundle.FilesSetDefsPanel_saveError(), ex);
169  }
170  }
171 
172  public void enableButtons(boolean isEnabled) {
173  boolean setSelected = (FilesSetDefsPanel.this.setsList.getSelectedValue() != null);
174  boolean ruleSelected = (FilesSetDefsPanel.this.rulesList.getSelectedValue() != null);
175  canBeEnabled = isEnabled;
176  newRuleButton.setEnabled(isEnabled);
177  copySetButton.setEnabled(isEnabled && setSelected);
178  newSetButton.setEnabled(isEnabled);
179  editRuleButton.setEnabled(isEnabled && ruleSelected);
180  editSetButton.setEnabled(isEnabled && setSelected);
181  exportSetButton.setEnabled(setSelected);
182  importSetButton.setEnabled(isEnabled);
183  deleteRuleButton.setEnabled(isEnabled && ruleSelected);
184  deleteSetButton.setEnabled(isEnabled && setSelected);
185  ingestWarningLabel.setVisible(!isEnabled);
186  }
187 
188  @Override
189  public void store() {
190  this.saveSettings();
191  }
192 
193  @Override
194  public void load() {
195  this.resetComponents();
196 
197  try {
198  // Get a working copy of the interesting files set definitions and sort
199  // by set name.
200  if (panelType == PANEL_TYPE.FILE_INGEST_FILTERS) {
201  this.filesSets = new TreeMap<>(FilesSetsManager.getInstance().getCustomFileIngestFilters());
202  } else {
203  this.filesSets = new TreeMap<>(FilesSetsManager.getInstance().getInterestingFilesSets());
204  }
205 
207  MessageNotifyUtil.Message.error(Bundle.FilesSetDefsPanel_loadError());
208  logger.log(Level.WARNING, Bundle.FilesSetDefsPanel_loadError(), ex);
209  this.filesSets = new TreeMap<>();
210  }
211 
212  // Populate the list model for the interesting files sets list
213  // component.
214  this.filesSets.values().forEach((set) -> {
215  this.setsListModel.addElement(set);
216  });
217 
218  if (!this.filesSets.isEmpty()) {
219  // Select the first files set by default. The list selections
220  // listeners will then populate the other components.
221  EventQueue.invokeLater(() -> {
222  FilesSetDefsPanel.this.setsList.setSelectedIndex(0);
223  });
224  }
225  }
226 
230  private void resetComponents() {
231  this.resetRuleComponents();
232  this.setsListModel.clear();
233  this.setDescriptionTextArea.setText("");
234  this.ignoreKnownFilesCheckbox.setSelected(true);
235  this.ingoreUnallocCheckbox.setSelected(true);
236  this.newSetButton.setEnabled(true && canBeEnabled);
237  this.editSetButton.setEnabled(false);
238  this.copySetButton.setEnabled(false);
239  this.exportSetButton.setEnabled(false);
240  this.importSetButton.setEnabled(true && canBeEnabled);
241  this.deleteSetButton.setEnabled(false);
242  }
243 
248  private void resetRuleComponents() {
249  this.fileNameTextField.setText("");
250  this.fileNameRadioButton.setSelected(true);
251  this.fileNameRegexCheckbox.setSelected(false);
252  this.filesRadioButton.setSelected(true);
253  this.rulePathConditionTextField.setText("");
254  this.daysIncludedTextField.setText("");
255  this.rulePathConditionRegexCheckBox.setSelected(false);
256  this.mimeTypeComboBox.setSelectedIndex(0);
257  this.equalitySignComboBox.setSelectedIndex(2);
258  this.fileSizeUnitComboBox.setSelectedIndex(1);
259  this.fileSizeSpinner.setValue(0);
260  this.newRuleButton.setEnabled(!this.setsListModel.isEmpty() && canBeEnabled);
261  this.editRuleButton.setEnabled(false);
262  this.deleteRuleButton.setEnabled(false);
263  }
264 
268  private final class SetsListSelectionListener implements ListSelectionListener {
269 
270  @Override
271  public void valueChanged(ListSelectionEvent e) {
272  if (e.getValueIsAdjusting()) {
273  return;
274  }
275  FilesSetDefsPanel.this.rulesListModel.clear();
277  //enable the new button
278  FilesSetDefsPanel.this.newSetButton.setEnabled(canBeEnabled);
279  FilesSetDefsPanel.this.importSetButton.setEnabled(canBeEnabled);
280  // Get the selected interesting files set and populate the set
281  // components.
282  FilesSet selectedSet = FilesSetDefsPanel.this.setsList.getSelectedValue();
283 
284  if (selectedSet != null) {
285  // Populate the components that display the properties of the
286  // selected files set.
287  FilesSetDefsPanel.this.setDescriptionTextArea.setText(selectedSet.getDescription());
288  FilesSetDefsPanel.this.ignoreKnownFilesCheckbox.setSelected(selectedSet.ignoresKnownFiles());
289  FilesSetDefsPanel.this.ingoreUnallocCheckbox.setSelected(selectedSet.ingoresUnallocatedSpace());
290  // Enable the copy, export, edit and delete set buttons.
291  FilesSetDefsPanel.this.editSetButton.setEnabled(canBeEnabled);
292  FilesSetDefsPanel.this.deleteSetButton.setEnabled(canBeEnabled);
293  FilesSetDefsPanel.this.copySetButton.setEnabled(canBeEnabled);
294  FilesSetDefsPanel.this.exportSetButton.setEnabled(true);
295  // Populate the rule definitions list, sorted by name.
296  TreeMap<String, FilesSet.Rule> rules = new TreeMap<>(selectedSet.getRules());
297  rules.values().forEach((rule) -> {
298  FilesSetDefsPanel.this.rulesListModel.addElement(rule);
299  });
300  // Select the first rule by default.
301  if (!FilesSetDefsPanel.this.rulesListModel.isEmpty()) {
302  FilesSetDefsPanel.this.rulesList.setSelectedIndex(0);
303  }
304  }
305  }
306 
307  }
308 
313  private final class RulesListSelectionListener implements ListSelectionListener {
314 
315  @Override
316  public void valueChanged(ListSelectionEvent e) {
317  if (e.getValueIsAdjusting()) {
318  return;
319  }
320 
321  // Get the selected rule and populate the rule components.
322  FilesSet.Rule rule = FilesSetDefsPanel.this.rulesList.getSelectedValue();
323  if (rule != null) {
324  // Get the conditions that make up the rule.
325  FilesSet.Rule.FileNameCondition nameCondition = rule.getFileNameCondition();
326  FilesSet.Rule.MetaTypeCondition typeCondition = rule.getMetaTypeCondition();
327  FilesSet.Rule.ParentPathCondition pathCondition = rule.getPathCondition();
328  FilesSet.Rule.MimeTypeCondition mimeTypeCondition = rule.getMimeTypeCondition();
329  FilesSet.Rule.FileSizeCondition fileSizeCondition = rule.getFileSizeCondition();
330  FilesSet.Rule.DateCondition dateCondition = rule.getDateCondition();
331  // Populate the components that display the properties of the
332  // selected rule.
333  if (nameCondition != null) {
334  FilesSetDefsPanel.this.fileNameTextField.setText(nameCondition.getTextToMatch());
335  FilesSetDefsPanel.this.fileNameRadioButton.setSelected(nameCondition instanceof FilesSet.Rule.FullNameCondition);
336  FilesSetDefsPanel.this.fileNameExtensionRadioButton.setSelected(nameCondition instanceof FilesSet.Rule.ExtensionCondition);
337  FilesSetDefsPanel.this.fileNameRegexCheckbox.setSelected(nameCondition.isRegex());
338  } else {
339  FilesSetDefsPanel.this.fileNameTextField.setText("");
340  FilesSetDefsPanel.this.fileNameRadioButton.setSelected(true);
341  FilesSetDefsPanel.this.fileNameExtensionRadioButton.setSelected(false);
342  FilesSetDefsPanel.this.fileNameRegexCheckbox.setSelected(false);
343  }
344  switch (typeCondition.getMetaType()) {
345  case FILES:
346  FilesSetDefsPanel.this.filesRadioButton.setSelected(true);
347  break;
348  case DIRECTORIES:
349  FilesSetDefsPanel.this.dirsRadioButton.setSelected(true);
350  break;
351  case FILES_AND_DIRECTORIES:
352  FilesSetDefsPanel.this.allRadioButton.setSelected(true);
353  break;
354  }
355  if (pathCondition != null) {
356  FilesSetDefsPanel.this.rulePathConditionTextField.setText(pathCondition.getTextToMatch());
357  FilesSetDefsPanel.this.rulePathConditionRegexCheckBox.setSelected(pathCondition.isRegex());
358  } else {
360  FilesSetDefsPanel.this.rulePathConditionRegexCheckBox.setSelected(false);
361  }
362  if (mimeTypeCondition != null) {
363  FilesSetDefsPanel.this.mimeTypeComboBox.setSelectedItem(mimeTypeCondition.getMimeType());
364  } else {
365  FilesSetDefsPanel.this.mimeTypeComboBox.setSelectedIndex(0);
366  }
367  if (fileSizeCondition != null) {
368  FilesSetDefsPanel.this.fileSizeUnitComboBox.setSelectedItem(fileSizeCondition.getUnit().getName());
369  FilesSetDefsPanel.this.equalitySignComboBox.setSelectedItem(fileSizeCondition.getComparator().getSymbol());
370  FilesSetDefsPanel.this.fileSizeSpinner.setValue(fileSizeCondition.getSizeValue());
371  } else {
372  FilesSetDefsPanel.this.fileSizeUnitComboBox.setSelectedIndex(1);
373  FilesSetDefsPanel.this.equalitySignComboBox.setSelectedIndex(2);
374  FilesSetDefsPanel.this.fileSizeSpinner.setValue(0);
375  }
376  if (dateCondition != null){
377  FilesSetDefsPanel.this.daysIncludedTextField.setText(Integer.toString(dateCondition.getDaysIncluded()));
378  }
379  else {
380  FilesSetDefsPanel.this.daysIncludedTextField.setText("");
381  }
382  // Enable the new, edit and delete rule buttons.
383  FilesSetDefsPanel.this.newRuleButton.setEnabled(true && canBeEnabled);
384  FilesSetDefsPanel.this.editRuleButton.setEnabled(true && canBeEnabled);
385  FilesSetDefsPanel.this.deleteRuleButton.setEnabled(true && canBeEnabled);
386  } else {
388  }
389  }
390 
391  }
392 
404  private void doFileSetsDialog(FilesSet selectedSet, boolean shouldCreateNew) {
405  // Create a files set defintion panle.
406  FilesSetPanel panel;
407  if (selectedSet != null) {
408  // Editing an existing set definition.
409  panel = new FilesSetPanel(selectedSet, panelType);
410  } else {
411  // Creating a new set definition.
412  panel = new FilesSetPanel(panelType);
413  }
414 
415  // Do a dialog box with the files set panel until the user either enters
416  // a valid definition or cancels. Note that the panel gives the user
417  // feedback when isValidDefinition() is called.
418  int option = JOptionPane.OK_OPTION;
419  do {
420  option = JOptionPane.showConfirmDialog(null, panel, NbBundle.getMessage(FilesSetPanel.class, filterDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
421  } while (option == JOptionPane.OK_OPTION && !panel.isValidDefinition());
422 
423  // While adding new ruleset(selectedSet == null), if rule set with same name already exists, do not add to the filesSets hashMap.
424  // In case of editing an existing ruleset(selectedSet != null), following check is not performed.
425  if (this.filesSets.containsKey(panel.getFilesSetName()) && shouldCreateNew) {
426  MessageNotifyUtil.Message.error(NbBundle.getMessage(this.getClass(),
427  "FilesSetDefsPanel.doFileSetsDialog.duplicateRuleSet.text",
428  panel.getFilesSetName()));
429  return;
430  }
431 
432  if (option == JOptionPane.OK_OPTION) {
433  Map<String, FilesSet.Rule> rules = new HashMap<>();
434  if (selectedSet != null) {
435  // Interesting file sets are immutable for thread safety,
436  // so editing a files set definition is a replacement operation.
437  // Preserve the existing rules from the set being edited.
438  rules.putAll(selectedSet.getRules());
439  }
440  if (shouldCreateNew) {
441  this.replaceFilesSet(null, panel.getFilesSetName(), panel.getFilesSetDescription(), panel.getFileSetIgnoresKnownFiles(), panel.getFileSetIgnoresUnallocatedSpace(), rules);
442  } else {
443  this.replaceFilesSet(selectedSet, panel.getFilesSetName(), panel.getFilesSetDescription(), panel.getFileSetIgnoresKnownFiles(), panel.getFileSetIgnoresUnallocatedSpace(), rules);
444  }
445  }
446  }
447 
455  private void doFilesSetRuleDialog(FilesSet.Rule selectedRule) {
456  // Create a files set rule panel.
457  FilesSetRulePanel panel;
458  if (selectedRule != null) {
459  // Editing an existing rule definition.
460  panel = new FilesSetRulePanel(selectedRule, okButton, cancelButton, panelType);
461  } else {
462  // Creating a new rule definition.
463  panel = new FilesSetRulePanel(okButton, cancelButton, panelType);
464  }
465  // Do a dialog box with the files set panel until the user either enters
466  // a valid definition or cancels. Note that the panel gives the user
467  // feedback when isValidDefinition() is called.
468  int option = JOptionPane.OK_OPTION;
469  do {
470  option = JOptionPane.showOptionDialog(null, panel, NbBundle.getMessage(FilesSetPanel.class, ruleDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, new Object[]{okButton, cancelButton}, okButton);
471 
472  } while (option == JOptionPane.OK_OPTION && !panel.isValidRuleDefinition());
473 
474  if (option == JOptionPane.OK_OPTION) {
475  // Interesting file sets are immutable for thread safety,
476  // so editing a files set rule definition is a replacement
477  // operation. Preserve the existing rules from the set being edited.
478  FilesSet selectedSet = this.setsList.getSelectedValue();
479  Map<String, FilesSet.Rule> rules = new HashMap<>(selectedSet.getRules());
480 
481  // Remove the "old" rule definition and add the new/edited
482  // definition.
483  if (selectedRule != null) {
484  rules.remove(selectedRule.getUuid());
485  }
486  FilesSet.Rule newRule = new FilesSet.Rule(panel.getRuleName(), panel.getFileNameCondition(), panel.getMetaTypeCondition(), panel.getPathCondition(), panel.getMimeTypeCondition(), panel.getFileSizeCondition(), panel.getDateCondition());
487  rules.put(newRule.getUuid(), newRule);
488 
489  // Add the new/edited files set definition, replacing any previous
490  // definition with the same name and refreshing the display.
491  this.replaceFilesSet(selectedSet, selectedSet.getName(), selectedSet.getDescription(), selectedSet.ignoresKnownFiles(), selectedSet.ingoresUnallocatedSpace(), rules);
492 
493  // Select the new/edited rule. Queue it up so it happens after the
494  // selection listeners react to the selection of the "new" files
495  // set.
496  EventQueue.invokeLater(() -> {
497  this.rulesList.setSelectedValue(newRule, true);
498  });
499  }
500  }
501 
517  void replaceFilesSet(FilesSet oldSet, String name, String description, boolean ignoresKnownFiles, boolean ignoresUnallocatedSpace, Map<String, FilesSet.Rule> rules) {
518  if (oldSet != null) {
519  // Remove the set to be replaced from the working copy if the files
520  // set definitions.
521  this.filesSets.remove(oldSet.getName());
522  }
523 
524  // Make the new/edited set definition and add it to the working copy of
525  // the files set definitions.
526  FilesSet newSet = new FilesSet(name, description, ignoresKnownFiles, ignoresUnallocatedSpace, rules);
527  this.filesSets.put(newSet.getName(), newSet);
528 
529  // Redo the list model for the files set list component, which will make
530  // everything stays sorted as in the working copy tree set.
531  FilesSetDefsPanel.this.setsListModel.clear();
532  this.filesSets.values().forEach((set) -> {
533  this.setsListModel.addElement(set);
534  });
535 
536  // Select the new/edited files set definition in the set definitions
537  // list. This will cause the selection listeners to repopulate the
538  // subordinate components.
539  this.setsList.setSelectedValue(newSet, true);
540  }
541 
547  @SuppressWarnings("unchecked")
548  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
549  private void initComponents() {
550 
551  fileNameButtonGroup = new javax.swing.ButtonGroup();
552  typeButtonGroup = new javax.swing.ButtonGroup();
553  jScrollPane1 = new javax.swing.JScrollPane();
554  jPanel1 = new javax.swing.JPanel();
555  jLabel6 = new javax.swing.JLabel();
556  newRuleButton = new javax.swing.JButton();
557  filesRadioButton = new javax.swing.JRadioButton();
558  editRuleButton = new javax.swing.JButton();
559  rulesListLabel = new javax.swing.JLabel();
560  rulesListScrollPane = new javax.swing.JScrollPane();
561  rulesList = new javax.swing.JList<>();
562  setDescScrollPanel = new javax.swing.JScrollPane();
563  setDescriptionTextArea = new javax.swing.JTextArea();
564  editSetButton = new javax.swing.JButton();
565  setsListScrollPane = new javax.swing.JScrollPane();
566  setsList = new javax.swing.JList<>();
567  fileNameExtensionRadioButton = new javax.swing.JRadioButton();
568  jLabel3 = new javax.swing.JLabel();
569  fileNameTextField = new javax.swing.JTextField();
570  jLabel5 = new javax.swing.JLabel();
571  fileNameRadioButton = new javax.swing.JRadioButton();
572  rulePathConditionTextField = new javax.swing.JTextField();
573  ignoreKnownFilesCheckbox = new javax.swing.JCheckBox();
574  fileNameRegexCheckbox = new javax.swing.JCheckBox();
575  separator = new javax.swing.JSeparator();
576  setsListLabel = new javax.swing.JLabel();
577  allRadioButton = new javax.swing.JRadioButton();
578  deleteSetButton = new javax.swing.JButton();
579  deleteRuleButton = new javax.swing.JButton();
580  newSetButton = new javax.swing.JButton();
581  jLabel2 = new javax.swing.JLabel();
582  dirsRadioButton = new javax.swing.JRadioButton();
583  jLabel1 = new javax.swing.JLabel();
584  jLabel4 = new javax.swing.JLabel();
585  rulePathConditionRegexCheckBox = new javax.swing.JCheckBox();
586  jScrollPane2 = new javax.swing.JScrollPane();
587  jTextArea1 = new javax.swing.JTextArea();
588  jLabel7 = new javax.swing.JLabel();
589  mimeTypeComboBox = new javax.swing.JComboBox<>();
590  jLabel8 = new javax.swing.JLabel();
591  equalitySignComboBox = new javax.swing.JComboBox<String>();
592  fileSizeSpinner = new javax.swing.JSpinner();
593  fileSizeUnitComboBox = new javax.swing.JComboBox<String>();
594  ingoreUnallocCheckbox = new javax.swing.JCheckBox();
595  ingestWarningLabel = new javax.swing.JLabel();
596  copySetButton = new javax.swing.JButton();
597  importSetButton = new javax.swing.JButton();
598  exportSetButton = new javax.swing.JButton();
599  modifiedDateLabel = new javax.swing.JLabel();
600  daysIncludedTextField = new javax.swing.JTextField();
601  daysIncludedLabel = new javax.swing.JLabel();
602 
603  setFont(getFont().deriveFont(getFont().getStyle() & ~java.awt.Font.BOLD, 11));
604 
605  jScrollPane1.setFont(jScrollPane1.getFont().deriveFont(jScrollPane1.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
606 
607  jPanel1.setFont(jPanel1.getFont().deriveFont(jPanel1.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
608 
609  jLabel6.setFont(jLabel6.getFont().deriveFont(jLabel6.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
610  org.openide.awt.Mnemonics.setLocalizedText(jLabel6, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.interesting.jLabel6.text")); // NOI18N
611 
612  newRuleButton.setFont(newRuleButton.getFont().deriveFont(newRuleButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
613  newRuleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/add16.png"))); // NOI18N
614  org.openide.awt.Mnemonics.setLocalizedText(newRuleButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.newRuleButton.text")); // NOI18N
615  newRuleButton.addActionListener(new java.awt.event.ActionListener() {
616  public void actionPerformed(java.awt.event.ActionEvent evt) {
618  }
619  });
620 
622  filesRadioButton.setFont(filesRadioButton.getFont().deriveFont(filesRadioButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
623  filesRadioButton.setSelected(true);
624  org.openide.awt.Mnemonics.setLocalizedText(filesRadioButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.filesRadioButton.text")); // NOI18N
625  filesRadioButton.setEnabled(false);
626 
627  editRuleButton.setFont(editRuleButton.getFont().deriveFont(editRuleButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
628  editRuleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/edit16.png"))); // NOI18N
629  org.openide.awt.Mnemonics.setLocalizedText(editRuleButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.editRuleButton.text")); // NOI18N
630  editRuleButton.setEnabled(false);
631  editRuleButton.addActionListener(new java.awt.event.ActionListener() {
632  public void actionPerformed(java.awt.event.ActionEvent evt) {
634  }
635  });
636 
637  rulesListLabel.setFont(rulesListLabel.getFont().deriveFont(rulesListLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
638  org.openide.awt.Mnemonics.setLocalizedText(rulesListLabel, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.rulesListLabel.text")); // NOI18N
639 
640  rulesListScrollPane.setFont(rulesListScrollPane.getFont().deriveFont(rulesListScrollPane.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
641 
642  rulesList.setFont(rulesList.getFont().deriveFont(rulesList.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
643  rulesList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
644  rulesListScrollPane.setViewportView(rulesList);
645 
646  setDescScrollPanel.setFont(setDescScrollPanel.getFont().deriveFont(setDescScrollPanel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
647  setDescScrollPanel.setMinimumSize(new java.awt.Dimension(10, 22));
648  setDescScrollPanel.setPreferredSize(new java.awt.Dimension(14, 40));
649 
650  setDescriptionTextArea.setEditable(false);
651  setDescriptionTextArea.setBackground(new java.awt.Color(240, 240, 240));
652  setDescriptionTextArea.setColumns(20);
653  setDescriptionTextArea.setFont(setDescriptionTextArea.getFont().deriveFont(setDescriptionTextArea.getFont().getStyle() & ~java.awt.Font.BOLD, 13));
654  setDescriptionTextArea.setLineWrap(true);
655  setDescriptionTextArea.setRows(6);
656  setDescriptionTextArea.setMinimumSize(new java.awt.Dimension(10, 22));
658 
659  editSetButton.setFont(editSetButton.getFont().deriveFont(editSetButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
660  editSetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/edit16.png"))); // NOI18N
661  org.openide.awt.Mnemonics.setLocalizedText(editSetButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.interesting.editSetButton.text")); // NOI18N
662  editSetButton.setEnabled(false);
663  editSetButton.setMargin(new java.awt.Insets(2, 6, 2, 6));
664  editSetButton.setMaximumSize(new java.awt.Dimension(111, 25));
665  editSetButton.setMinimumSize(new java.awt.Dimension(111, 25));
666  editSetButton.setPreferredSize(new java.awt.Dimension(111, 25));
667  editSetButton.addActionListener(new java.awt.event.ActionListener() {
668  public void actionPerformed(java.awt.event.ActionEvent evt) {
670  }
671  });
672 
673  setsListScrollPane.setFont(setsListScrollPane.getFont().deriveFont(setsListScrollPane.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
674 
675  setsList.setFont(setsList.getFont().deriveFont(setsList.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
676  setsList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
677  setsListScrollPane.setViewportView(setsList);
678 
680  fileNameExtensionRadioButton.setFont(fileNameExtensionRadioButton.getFont().deriveFont(fileNameExtensionRadioButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
681  org.openide.awt.Mnemonics.setLocalizedText(fileNameExtensionRadioButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.fileNameExtensionRadioButton.text")); // NOI18N
682  fileNameExtensionRadioButton.setEnabled(false);
683 
684  jLabel3.setFont(jLabel3.getFont().deriveFont(jLabel3.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
685  org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.jLabel3.text")); // NOI18N
686 
687  fileNameTextField.setEditable(false);
688  fileNameTextField.setFont(fileNameTextField.getFont().deriveFont(fileNameTextField.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
689  fileNameTextField.setText(org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.fileNameTextField.text")); // NOI18N
690 
691  jLabel5.setFont(jLabel5.getFont().deriveFont(jLabel5.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
692  org.openide.awt.Mnemonics.setLocalizedText(jLabel5, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.jLabel5.text")); // NOI18N
693 
695  fileNameRadioButton.setFont(fileNameRadioButton.getFont().deriveFont(fileNameRadioButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
696  org.openide.awt.Mnemonics.setLocalizedText(fileNameRadioButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.fileNameRadioButton.text")); // NOI18N
697  fileNameRadioButton.setEnabled(false);
698 
699  rulePathConditionTextField.setEditable(false);
700  rulePathConditionTextField.setFont(rulePathConditionTextField.getFont().deriveFont(rulePathConditionTextField.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
701  rulePathConditionTextField.setText(org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.rulePathConditionTextField.text")); // NOI18N
702 
703  ignoreKnownFilesCheckbox.setFont(ignoreKnownFilesCheckbox.getFont().deriveFont(ignoreKnownFilesCheckbox.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
704  org.openide.awt.Mnemonics.setLocalizedText(ignoreKnownFilesCheckbox, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.ignoreKnownFilesCheckbox.text")); // NOI18N
705  ignoreKnownFilesCheckbox.setEnabled(false);
706 
707  fileNameRegexCheckbox.setFont(fileNameRegexCheckbox.getFont().deriveFont(fileNameRegexCheckbox.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
708  org.openide.awt.Mnemonics.setLocalizedText(fileNameRegexCheckbox, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.fileNameRegexCheckbox.text")); // NOI18N
709  fileNameRegexCheckbox.setEnabled(false);
710 
711  separator.setOrientation(javax.swing.SwingConstants.VERTICAL);
712 
713  setsListLabel.setFont(setsListLabel.getFont().deriveFont(setsListLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
714  org.openide.awt.Mnemonics.setLocalizedText(setsListLabel, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.interesting.setsListLabel.text")); // NOI18N
715 
717  allRadioButton.setFont(allRadioButton.getFont().deriveFont(allRadioButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
718  org.openide.awt.Mnemonics.setLocalizedText(allRadioButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.allRadioButton.text")); // NOI18N
719  allRadioButton.setEnabled(false);
720 
721  deleteSetButton.setFont(deleteSetButton.getFont().deriveFont(deleteSetButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
722  deleteSetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/delete16.png"))); // NOI18N
723  org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.interesting.deleteSetButton.text")); // NOI18N
724  deleteSetButton.setEnabled(false);
725  deleteSetButton.setMargin(new java.awt.Insets(2, 6, 2, 6));
726  deleteSetButton.setMaximumSize(new java.awt.Dimension(111, 25));
727  deleteSetButton.setMinimumSize(new java.awt.Dimension(111, 25));
728  deleteSetButton.setPreferredSize(new java.awt.Dimension(111, 25));
729  deleteSetButton.addActionListener(new java.awt.event.ActionListener() {
730  public void actionPerformed(java.awt.event.ActionEvent evt) {
732  }
733  });
734 
735  deleteRuleButton.setFont(deleteRuleButton.getFont().deriveFont(deleteRuleButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
736  deleteRuleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/delete16.png"))); // NOI18N
737  org.openide.awt.Mnemonics.setLocalizedText(deleteRuleButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.deleteRuleButton.text")); // NOI18N
738  deleteRuleButton.setEnabled(false);
739  deleteRuleButton.addActionListener(new java.awt.event.ActionListener() {
740  public void actionPerformed(java.awt.event.ActionEvent evt) {
742  }
743  });
744 
745  newSetButton.setFont(newSetButton.getFont().deriveFont(newSetButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
746  newSetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/add16.png"))); // NOI18N
747  org.openide.awt.Mnemonics.setLocalizedText(newSetButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.interesting.newSetButton.text")); // NOI18N
748  newSetButton.setMargin(new java.awt.Insets(2, 6, 2, 6));
749  newSetButton.setMaximumSize(new java.awt.Dimension(111, 25));
750  newSetButton.setMinimumSize(new java.awt.Dimension(111, 25));
751  newSetButton.setPreferredSize(new java.awt.Dimension(111, 25));
752  newSetButton.addActionListener(new java.awt.event.ActionListener() {
753  public void actionPerformed(java.awt.event.ActionEvent evt) {
755  }
756  });
757 
758  jLabel2.setFont(jLabel2.getFont().deriveFont(jLabel2.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
759  org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.jLabel2.text")); // NOI18N
760 
762  dirsRadioButton.setFont(dirsRadioButton.getFont().deriveFont(dirsRadioButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
763  org.openide.awt.Mnemonics.setLocalizedText(dirsRadioButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.dirsRadioButton.text")); // NOI18N
764  dirsRadioButton.setEnabled(false);
765 
766  jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
767  org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.jLabel1.text")); // NOI18N
768 
769  jLabel4.setFont(jLabel4.getFont().deriveFont(jLabel4.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
770  org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.jLabel4.text")); // NOI18N
771 
772  rulePathConditionRegexCheckBox.setFont(rulePathConditionRegexCheckBox.getFont().deriveFont(rulePathConditionRegexCheckBox.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
773  org.openide.awt.Mnemonics.setLocalizedText(rulePathConditionRegexCheckBox, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.rulePathConditionRegexCheckBox.text")); // NOI18N
774  rulePathConditionRegexCheckBox.setEnabled(false);
775 
776  jScrollPane2.setFont(jScrollPane2.getFont().deriveFont(jScrollPane2.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
777 
778  jTextArea1.setEditable(false);
779  jTextArea1.setBackground(new java.awt.Color(240, 240, 240));
780  jTextArea1.setColumns(20);
781  jTextArea1.setFont(jTextArea1.getFont().deriveFont(jTextArea1.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
782  jTextArea1.setLineWrap(true);
783  jTextArea1.setRows(3);
784  jTextArea1.setText(org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.interesting.jTextArea1.text")); // NOI18N
785  jTextArea1.setWrapStyleWord(true);
786  jScrollPane2.setViewportView(jTextArea1);
787 
788  org.openide.awt.Mnemonics.setLocalizedText(jLabel7, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.jLabel7.text")); // NOI18N
789 
790  mimeTypeComboBox.setBackground(new java.awt.Color(240, 240, 240));
791  mimeTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel<String>(new String[] {""}));
792  mimeTypeComboBox.setEnabled(false);
793  mimeTypeComboBox.setMinimumSize(new java.awt.Dimension(0, 20));
794  mimeTypeComboBox.setPreferredSize(new java.awt.Dimension(12, 20));
795 
796  org.openide.awt.Mnemonics.setLocalizedText(jLabel8, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.jLabel8.text")); // NOI18N
797 
798  equalitySignComboBox.setModel(new javax.swing.DefaultComboBoxModel<String>(new String[] { "=", ">", "≥", "<", "≤" }));
799  equalitySignComboBox.setEnabled(false);
800 
801  fileSizeSpinner.setEnabled(false);
802  fileSizeSpinner.setMinimumSize(new java.awt.Dimension(2, 20));
803 
804  fileSizeUnitComboBox.setModel(new javax.swing.DefaultComboBoxModel<String>(new String[] { Bundle.FilesSetDefsPanel_bytes(), Bundle.FilesSetDefsPanel_kiloBytes(), Bundle.FilesSetDefsPanel_megaBytes(), Bundle.FilesSetDefsPanel_gigaBytes() }));
805  fileSizeUnitComboBox.setEnabled(false);
806 
807  org.openide.awt.Mnemonics.setLocalizedText(ingoreUnallocCheckbox, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.ingoreUnallocCheckbox.text")); // NOI18N
808  ingoreUnallocCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.ingoreUnallocCheckbox.toolTipText")); // NOI18N
809  ingoreUnallocCheckbox.setEnabled(false);
810 
811  ingestWarningLabel.setFont(ingestWarningLabel.getFont().deriveFont(ingestWarningLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
812  ingestWarningLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png"))); // NOI18N
813  org.openide.awt.Mnemonics.setLocalizedText(ingestWarningLabel, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.ingestWarningLabel.text")); // NOI18N
814 
815  copySetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/new16.png"))); // NOI18N
816  org.openide.awt.Mnemonics.setLocalizedText(copySetButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.interesting.copySetButton.text")); // NOI18N
817  copySetButton.setEnabled(false);
818  copySetButton.setMargin(new java.awt.Insets(2, 6, 2, 6));
819  copySetButton.setMaximumSize(new java.awt.Dimension(111, 25));
820  copySetButton.setMinimumSize(new java.awt.Dimension(111, 25));
821  copySetButton.setPreferredSize(new java.awt.Dimension(111, 25));
822  copySetButton.addActionListener(new java.awt.event.ActionListener() {
823  public void actionPerformed(java.awt.event.ActionEvent evt) {
825  }
826  });
827 
828  importSetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/import16.png"))); // NOI18N
829  org.openide.awt.Mnemonics.setLocalizedText(importSetButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.interesting.importSetButton.text")); // NOI18N
830  importSetButton.setMargin(new java.awt.Insets(2, 6, 2, 6));
831  importSetButton.setMaximumSize(new java.awt.Dimension(111, 25));
832  importSetButton.setMinimumSize(new java.awt.Dimension(111, 25));
833  importSetButton.setPreferredSize(new java.awt.Dimension(111, 25));
834  importSetButton.addActionListener(new java.awt.event.ActionListener() {
835  public void actionPerformed(java.awt.event.ActionEvent evt) {
837  }
838  });
839 
840  exportSetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/export16.png"))); // NOI18N
841  org.openide.awt.Mnemonics.setLocalizedText(exportSetButton, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.interesting.exportSetButton.text")); // NOI18N
842  exportSetButton.setEnabled(false);
843  exportSetButton.setMargin(new java.awt.Insets(2, 6, 2, 6));
844  exportSetButton.setMaximumSize(new java.awt.Dimension(111, 25));
845  exportSetButton.setMinimumSize(new java.awt.Dimension(111, 25));
846  exportSetButton.setPreferredSize(new java.awt.Dimension(111, 25));
847  exportSetButton.addActionListener(new java.awt.event.ActionListener() {
848  public void actionPerformed(java.awt.event.ActionEvent evt) {
850  }
851  });
852 
853  org.openide.awt.Mnemonics.setLocalizedText(modifiedDateLabel, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.modifiedDateLabel.text")); // NOI18N
854 
855  daysIncludedTextField.setEditable(false);
856  daysIncludedTextField.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
857  daysIncludedTextField.setText(org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.daysIncludedTextField.text")); // NOI18N
858  daysIncludedTextField.setMinimumSize(new java.awt.Dimension(60, 20));
859  daysIncludedTextField.setPreferredSize(new java.awt.Dimension(60, 20));
860 
861  org.openide.awt.Mnemonics.setLocalizedText(daysIncludedLabel, org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.daysIncludedLabel.text")); // NOI18N
862  daysIncludedLabel.setEnabled(false);
863 
864  javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
865  jPanel1.setLayout(jPanel1Layout);
866  jPanel1Layout.setHorizontalGroup(
867  jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
868  .addGroup(jPanel1Layout.createSequentialGroup()
869  .addContainerGap()
870  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
871  .addGroup(jPanel1Layout.createSequentialGroup()
872  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
873  .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
874  .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
875  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
876  .addComponent(importSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
877  .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
878  .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
879  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
880  .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
881  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
882  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
883  .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
884  .addComponent(deleteSetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
885  .addComponent(setsListScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
886  .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
887  .addComponent(setsListLabel))
888  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
889  .addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
890  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
891  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
892  .addGroup(jPanel1Layout.createSequentialGroup()
893  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
894  .addComponent(rulesListScrollPane, javax.swing.GroupLayout.Alignment.TRAILING)
895  .addComponent(setDescScrollPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
896  .addGroup(jPanel1Layout.createSequentialGroup()
897  .addGap(16, 16, 16)
898  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
899  .addComponent(jLabel7)
900  .addComponent(jLabel8)
901  .addComponent(jLabel2)
902  .addComponent(jLabel4)
903  .addComponent(modifiedDateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
904  .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
905  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
906  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
907  .addComponent(rulePathConditionTextField)
908  .addComponent(fileNameTextField, javax.swing.GroupLayout.Alignment.TRAILING)
909  .addComponent(mimeTypeComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
910  .addGroup(jPanel1Layout.createSequentialGroup()
911  .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
912  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
913  .addComponent(fileSizeSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
914  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
915  .addComponent(fileSizeUnitComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
916  .addGroup(jPanel1Layout.createSequentialGroup()
917  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
918  .addComponent(fileNameRadioButton)
919  .addComponent(rulePathConditionRegexCheckBox)
920  .addGroup(jPanel1Layout.createSequentialGroup()
921  .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
922  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
923  .addComponent(daysIncludedLabel))
924  .addGroup(jPanel1Layout.createSequentialGroup()
925  .addComponent(filesRadioButton, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
926  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
927  .addComponent(dirsRadioButton)
928  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
929  .addComponent(allRadioButton)))
930  .addGap(0, 0, Short.MAX_VALUE)))))
931  .addGap(8, 8, 8))
932  .addGroup(jPanel1Layout.createSequentialGroup()
933  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
934  .addComponent(rulesListLabel)
935  .addGroup(jPanel1Layout.createSequentialGroup()
936  .addComponent(ignoreKnownFilesCheckbox)
937  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
938  .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
939  .addGroup(jPanel1Layout.createSequentialGroup()
940  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
941  .addComponent(jLabel5)
942  .addComponent(jLabel6))
943  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
944  .addComponent(ingestWarningLabel))
945  .addGroup(jPanel1Layout.createSequentialGroup()
946  .addGap(174, 174, 174)
947  .addComponent(fileNameExtensionRadioButton)
948  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
949  .addComponent(fileNameRegexCheckbox))
950  .addComponent(jLabel1)
951  .addGroup(jPanel1Layout.createSequentialGroup()
952  .addComponent(newRuleButton)
953  .addGap(18, 18, 18)
954  .addComponent(editRuleButton)
955  .addGap(18, 18, 18)
956  .addComponent(deleteRuleButton)))
957  .addGap(24, 28, Short.MAX_VALUE))))
958  );
959 
960  jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {copySetButton, deleteSetButton, editSetButton, exportSetButton, importSetButton, newSetButton});
961 
962  jPanel1Layout.setVerticalGroup(
963  jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
964  .addGroup(jPanel1Layout.createSequentialGroup()
965  .addContainerGap()
966  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
967  .addComponent(separator)
968  .addGroup(jPanel1Layout.createSequentialGroup()
969  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
970  .addGroup(jPanel1Layout.createSequentialGroup()
971  .addComponent(jLabel6)
972  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
973  .addComponent(jLabel5)
974  .addGap(1, 1, 1))
975  .addComponent(ingestWarningLabel, javax.swing.GroupLayout.Alignment.TRAILING))
976  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
977  .addComponent(setDescScrollPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
978  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
979  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
980  .addComponent(ignoreKnownFilesCheckbox)
981  .addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
982  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
983  .addComponent(rulesListLabel)
984  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
985  .addComponent(rulesListScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE)
986  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
987  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
988  .addComponent(newRuleButton)
989  .addComponent(editRuleButton)
990  .addComponent(deleteRuleButton))
991  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
992  .addComponent(jLabel1)
993  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
994  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
995  .addComponent(jLabel2)
996  .addComponent(filesRadioButton)
997  .addComponent(dirsRadioButton)
998  .addComponent(allRadioButton))
999  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1000  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1001  .addComponent(jLabel3)
1002  .addComponent(fileNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
1003  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1004  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1005  .addComponent(fileNameRadioButton)
1006  .addComponent(fileNameExtensionRadioButton)
1007  .addComponent(fileNameRegexCheckbox))
1008  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1009  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1010  .addComponent(jLabel4)
1011  .addComponent(rulePathConditionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
1012  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1013  .addComponent(rulePathConditionRegexCheckBox)
1014  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1015  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1016  .addComponent(jLabel7)
1017  .addComponent(mimeTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1018  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1019  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1020  .addComponent(jLabel8)
1021  .addComponent(equalitySignComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1022  .addComponent(fileSizeSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1023  .addComponent(fileSizeUnitComboBox, 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(modifiedDateLabel)
1027  .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1028  .addComponent(daysIncludedLabel))
1029  .addContainerGap())
1030  .addGroup(jPanel1Layout.createSequentialGroup()
1031  .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1032  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1033  .addComponent(setsListLabel)
1034  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1035  .addComponent(setsListScrollPane)
1036  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1037  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1038  .addComponent(newSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1039  .addComponent(editSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1040  .addComponent(deleteSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1041  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1042  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1043  .addComponent(copySetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1044  .addComponent(importSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1045  .addComponent(exportSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1046  .addGap(6, 6, 6))))
1047  );
1048 
1049  jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {copySetButton, deleteRuleButton, deleteSetButton, editRuleButton, editSetButton, exportSetButton, importSetButton, newRuleButton, newSetButton});
1050 
1051  jScrollPane1.setViewportView(jPanel1);
1052 
1053  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
1054  this.setLayout(layout);
1055  layout.setHorizontalGroup(
1056  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1057  .addComponent(jScrollPane1)
1058  );
1059  layout.setVerticalGroup(
1060  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1061  .addComponent(jScrollPane1)
1062  );
1063  }// </editor-fold>//GEN-END:initComponents
1064 
1065  private void newSetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newSetButtonActionPerformed
1066  this.doFileSetsDialog(null, true);
1067  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1068  }//GEN-LAST:event_newSetButtonActionPerformed
1069 
1070  private void deleteRuleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteRuleButtonActionPerformed
1071  // Interesting file sets are immutable for thread safety,
1072  // so editing a files set rule definition is a replacement
1073  // operation. Preserve the existing rules from the set being
1074  // edited, except for the deleted rule.
1075  FilesSet oldSet = this.setsList.getSelectedValue();
1076  Map<String, FilesSet.Rule> rules = new HashMap<>(oldSet.getRules());
1077  FilesSet.Rule selectedRule = this.rulesList.getSelectedValue();
1078  rules.remove(selectedRule.getUuid());
1079  this.replaceFilesSet(oldSet, oldSet.getName(), oldSet.getDescription(), oldSet.ignoresKnownFiles(), oldSet.ingoresUnallocatedSpace(), rules);
1080  if (!this.rulesListModel.isEmpty()) {
1081  this.rulesList.setSelectedIndex(0);
1082  } else {
1083  this.resetRuleComponents();
1084  }
1085  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1086  }//GEN-LAST:event_deleteRuleButtonActionPerformed
1087 
1088  private void deleteSetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteSetButtonActionPerformed
1089  FilesSet selectedSet = this.setsList.getSelectedValue();
1090  if (panelType == PANEL_TYPE.FILE_INGEST_FILTERS) {
1091  for (IngestProfile profile : IngestProfiles.getIngestProfiles()) {
1092  if (profile.getFileIngestFilter().equals(selectedSet.getName())) {
1093  MessageNotifyUtil.Message.error(NbBundle.getMessage(this.getClass(),
1094  "FilesSetDefsPanel.ingest.fileFilterInUseError",
1095  selectedSet.getName(), profile.toString()));
1096  return;
1097  }
1098  }
1099 
1100  }
1101  this.filesSets.remove(selectedSet.getName());
1102  this.setsListModel.removeElement(selectedSet);
1103  // Select the first of the remaining set definitions. This will cause
1104  // the selection listeners to repopulate the subordinate components.
1105  if (!this.filesSets.isEmpty()) {
1106  this.setsList.setSelectedIndex(0);
1107  } else {
1108  this.resetComponents();
1109  }
1110  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1111  }//GEN-LAST:event_deleteSetButtonActionPerformed
1112 
1113  private void editSetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editSetButtonActionPerformed
1114  this.doFileSetsDialog(this.setsList.getSelectedValue(), false);
1115  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1116  }//GEN-LAST:event_editSetButtonActionPerformed
1117 
1118  private void editRuleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editRuleButtonActionPerformed
1119  this.doFilesSetRuleDialog(this.rulesList.getSelectedValue());
1120  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1121  }//GEN-LAST:event_editRuleButtonActionPerformed
1122 
1123  private void newRuleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newRuleButtonActionPerformed
1124  this.doFilesSetRuleDialog(null);
1125  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1126  }//GEN-LAST:event_newRuleButtonActionPerformed
1127 
1128  private void copySetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_copySetButtonActionPerformed
1129  this.doFileSetsDialog(this.setsList.getSelectedValue(), true);
1130  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1131  }//GEN-LAST:event_copySetButtonActionPerformed
1132  @NbBundle.Messages({
1133  "FilesSetDefsPanel.yesOwMsg=Yes, overwrite",
1134  "FilesSetDefsPanel.noSkipMsg=No, skip",
1135  "FilesSetDefsPanel.cancelImportMsg=Cancel import",
1136  "# {0} - FilesSet name",
1137  "FilesSetDefsPanel.interesting.overwriteSetPrompt=Interesting files set <{0}> already exists locally, overwrite?",
1138  "FilesSetDefsPanel.interesting.importOwConflict=Import Interesting files set conflict",
1139  "FilesSetDefsPanel.interesting.failImportMsg=Interesting files set not imported",
1140  "FilesSetDefsPanel.interesting.fileExtensionFilterLbl=Autopsy Interesting File Set File (xml)",
1141  "FilesSetDefsPanel.interesting.importButtonAction.featureName=Interesting Files Set Import"
1142  })
1143  private void importSetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importSetButtonActionPerformed
1144  //save currently selected value as default value to select
1145  FilesSet selectedSet = this.setsList.getSelectedValue();
1146  JFileChooser chooser = new JFileChooser();
1147  final String EXTENSION = "xml"; //NON-NLS
1148  FileNameExtensionFilter autopsyFilter = new FileNameExtensionFilter(
1149  NbBundle.getMessage(this.getClass(), "FilesSetDefsPanel.interesting.fileExtensionFilterLbl"), EXTENSION);
1150  chooser.addChoosableFileFilter(autopsyFilter);
1151  chooser.setAcceptAllFileFilterUsed(false);
1152  chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
1153  int returnVal = chooser.showOpenDialog(this);
1154  if (returnVal == JFileChooser.APPROVE_OPTION) {
1155  File selFile = chooser.getSelectedFile();
1156  if (selFile == null) {
1157  JOptionPane.showMessageDialog(this,
1158  NbBundle.getMessage(this.getClass(), "FilesSetDefsPanel.interesting.failImportMsg"),
1159  NbBundle.getMessage(this.getClass(), "FilesSetDefsPanel.interesting.importButtonAction.featureName"),
1160  JOptionPane.WARNING_MESSAGE);
1161  logger.warning("Selected file was null, when trying to import interesting files set definitions");
1162  return;
1163  }
1164  Collection<FilesSet> importedSets;
1165  try {
1166  importedSets = InterestingItemsFilesSetSettings.readDefinitionsXML(selFile).values(); //read the xml from that path
1167  if (importedSets.isEmpty()) {
1168  throw new FilesSetsManager.FilesSetsManagerException("No Files Sets were read from the xml.");
1169  }
1171  JOptionPane.showMessageDialog(this,
1172  NbBundle.getMessage(this.getClass(), "FilesSetDefsPanel.interesting.failImportMsg"),
1173  NbBundle.getMessage(this.getClass(), "FilesSetDefsPanel.interesting.importButtonAction.featureName"),
1174  JOptionPane.WARNING_MESSAGE);
1175  logger.log(Level.WARNING, "No Interesting files set definitions were read from the selected file, exception", ex);
1176  return;
1177  }
1178  for (FilesSet set : importedSets) {
1179  int choice = JOptionPane.OK_OPTION;
1180  if (filesSets.containsKey(set.getName())) {
1181  Object[] options = {NbBundle.getMessage(this.getClass(), "FilesSetDefsPanel.yesOwMsg"),
1182  NbBundle.getMessage(this.getClass(), "FilesSetDefsPanel.noSkipMsg"),
1183  NbBundle.getMessage(this.getClass(), "FilesSetDefsPanel.cancelImportMsg")};
1184  choice = JOptionPane.showOptionDialog(this,
1185  NbBundle.getMessage(this.getClass(), "FilesSetDefsPanel.interesting.overwriteSetPrompt", set.getName()),
1186  NbBundle.getMessage(this.getClass(), "FilesSetDefsPanel.interesting.importOwConflict"),
1187  JOptionPane.YES_NO_CANCEL_OPTION,
1188  JOptionPane.QUESTION_MESSAGE,
1189  null,
1190  options,
1191  options[0]);
1192  }
1193  if (choice == JOptionPane.OK_OPTION) {
1194  selectedSet = set;
1195  this.filesSets.put(set.getName(), set);
1196  } else if (choice == JOptionPane.CANCEL_OPTION) {
1197  break;
1198  }
1199  }
1200  // Redo the list model for the files set list component
1201  FilesSetDefsPanel.this.setsListModel.clear();
1202  this.filesSets.values().forEach((set) -> {
1203  this.setsListModel.addElement(set);
1204  });
1205  // Select the new/edited files set definition in the set definitions
1206  // list. This will cause the selection listeners to repopulate the
1207  // subordinate components.
1208  this.setsList.setSelectedValue(selectedSet, true);
1209  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1210  }
1211 
1212  }//GEN-LAST:event_importSetButtonActionPerformed
1213 
1214  @NbBundle.Messages({"FilesSetDefsPanel.interesting.exportButtonAction.featureName=Interesting Files Set Export",
1215  "# {0} - file name",
1216  "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt=File {0} exists, overwrite?",
1217  "FilesSetDefsPanel.interesting.ExportedMsg=Interesting files set exported",
1218  "FilesSetDefsPanel.interesting.failExportMsg=Export of interesting files set failed"})
1219  private void exportSetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exportSetButtonActionPerformed
1220  //display warning that existing filessets with duplicate names will be overwritten
1221  //create file chooser to get xml filefinal String FEATURE_NAME = NbBundle.getMessage(this.getClass(),
1222  JFileChooser chooser = new JFileChooser();
1223  final String EXTENSION = "xml"; //NON-NLS
1224  FileNameExtensionFilter autopsyFilter = new FileNameExtensionFilter(
1225  NbBundle.getMessage(this.getClass(), "FilesSetDefsPanel.interesting.fileExtensionFilterLbl"), EXTENSION);
1226  chooser.addChoosableFileFilter(autopsyFilter);
1227  chooser.setSelectedFile(new File(this.setsList.getSelectedValue().getName()));
1228  chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
1229  int returnVal = chooser.showSaveDialog(this);
1230  if (returnVal == JFileChooser.APPROVE_OPTION) {
1231  final String FEATURE_NAME = NbBundle.getMessage(this.getClass(),
1232  "FilesSetDefsPanel.interesting.exportButtonAction.featureName");
1233  File selFile = chooser.getSelectedFile();
1234  if (selFile == null) {
1235  JOptionPane.showMessageDialog(this,
1236  NbBundle.getMessage(this.getClass(), "FilesSetDefsPanel.interesting.failExportMsg"),
1237  FEATURE_NAME,
1238  JOptionPane.WARNING_MESSAGE);
1239  logger.warning("Selected file was null, when trying to export interesting files set definitions");
1240  return;
1241  }
1242  //force append extension if not given
1243  String fileAbs = selFile.getAbsolutePath();
1244  if (!fileAbs.endsWith("." + EXTENSION)) {
1245  fileAbs = fileAbs + "." + EXTENSION;
1246  selFile = new File(fileAbs);
1247  }
1248  if (selFile.exists()) {
1249  //if the file already exists ask the user how to proceed
1250  final String FILE_EXISTS_MESSAGE = NbBundle.getMessage(this.getClass(),
1251  "FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt", selFile.getName());
1252  boolean shouldWrite = JOptionPane.showConfirmDialog(null, FILE_EXISTS_MESSAGE, FEATURE_NAME, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION;
1253  if (!shouldWrite) {
1254  return;
1255  }
1256  }
1257  List<FilesSet> exportSets;
1258  exportSets = new ArrayList<>();
1259  //currently only exports selectedValue
1260  exportSets.add(this.setsList.getSelectedValue());
1261  boolean written = InterestingItemsFilesSetSettings.exportXmlDefinitionsFile(selFile, exportSets);
1262  if (written) {
1263  JOptionPane.showMessageDialog(
1264  WindowManager.getDefault().getMainWindow(),
1265  NbBundle.getMessage(this.getClass(), "FilesSetDefsPanel.interesting.ExportedMsg"),
1266  FEATURE_NAME,
1267  JOptionPane.INFORMATION_MESSAGE);
1268  } else {
1269  JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
1270  NbBundle.getMessage(this.getClass(), "FilesSetDefsPanel.interesting.failExportMsg"),
1271  FEATURE_NAME,
1272  JOptionPane.WARNING_MESSAGE);
1273  logger.warning("Export of interesting files set failed unable to write definitions xml file");
1274  }
1275  }
1276  }//GEN-LAST:event_exportSetButtonActionPerformed
1277 
1278  // Variables declaration - do not modify//GEN-BEGIN:variables
1279  private javax.swing.JRadioButton allRadioButton;
1280  private javax.swing.JButton copySetButton;
1281  private javax.swing.JLabel daysIncludedLabel;
1282  private javax.swing.JTextField daysIncludedTextField;
1283  private javax.swing.JButton deleteRuleButton;
1284  private javax.swing.JButton deleteSetButton;
1285  private javax.swing.JRadioButton dirsRadioButton;
1286  private javax.swing.JButton editRuleButton;
1287  private javax.swing.JButton editSetButton;
1288  private javax.swing.JComboBox<String> equalitySignComboBox;
1289  private javax.swing.JButton exportSetButton;
1290  private javax.swing.ButtonGroup fileNameButtonGroup;
1291  private javax.swing.JRadioButton fileNameExtensionRadioButton;
1292  private javax.swing.JRadioButton fileNameRadioButton;
1293  private javax.swing.JCheckBox fileNameRegexCheckbox;
1294  private javax.swing.JTextField fileNameTextField;
1295  private javax.swing.JSpinner fileSizeSpinner;
1296  private javax.swing.JComboBox<String> fileSizeUnitComboBox;
1297  private javax.swing.JRadioButton filesRadioButton;
1298  private javax.swing.JCheckBox ignoreKnownFilesCheckbox;
1299  private javax.swing.JButton importSetButton;
1300  private javax.swing.JLabel ingestWarningLabel;
1301  private javax.swing.JCheckBox ingoreUnallocCheckbox;
1302  private javax.swing.JLabel jLabel1;
1303  private javax.swing.JLabel jLabel2;
1304  private javax.swing.JLabel jLabel3;
1305  private javax.swing.JLabel jLabel4;
1306  private javax.swing.JLabel jLabel5;
1307  private javax.swing.JLabel jLabel6;
1308  private javax.swing.JLabel jLabel7;
1309  private javax.swing.JLabel jLabel8;
1310  private javax.swing.JPanel jPanel1;
1311  private javax.swing.JScrollPane jScrollPane1;
1312  private javax.swing.JScrollPane jScrollPane2;
1313  private javax.swing.JTextArea jTextArea1;
1314  private javax.swing.JComboBox<String> mimeTypeComboBox;
1315  private javax.swing.JLabel modifiedDateLabel;
1316  private javax.swing.JButton newRuleButton;
1317  private javax.swing.JButton newSetButton;
1318  private javax.swing.JCheckBox rulePathConditionRegexCheckBox;
1319  private javax.swing.JTextField rulePathConditionTextField;
1320  private javax.swing.JList<FilesSet.Rule> rulesList;
1321  private javax.swing.JLabel rulesListLabel;
1322  private javax.swing.JScrollPane rulesListScrollPane;
1323  private javax.swing.JSeparator separator;
1324  private javax.swing.JScrollPane setDescScrollPanel;
1325  private javax.swing.JTextArea setDescriptionTextArea;
1326  private javax.swing.JList<FilesSet> setsList;
1327  private javax.swing.JLabel setsListLabel;
1328  private javax.swing.JScrollPane setsListScrollPane;
1329  private javax.swing.ButtonGroup typeButtonGroup;
1330  // End of variables declaration//GEN-END:variables
1331 
1332 }
static synchronized List< IngestProfile > getIngestProfiles()
void doFileSetsDialog(FilesSet selectedSet, boolean shouldCreateNew)
synchronized static Logger getLogger(String name)
Definition: Logger.java:124
static synchronized SortedSet< String > getDetectedTypes()

Copyright © 2012-2016 Basis Technology. Generated on: Tue Feb 20 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.