Autopsy  4.10.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
FileExtMismatchModuleSettingsPanel.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.fileextmismatch;
20 
23 
28 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
29 final class FileExtMismatchModuleSettingsPanel extends IngestModuleIngestJobSettingsPanel {
30 
31  private static final long serialVersionUID = 1L;
32  private final FileExtMismatchDetectorModuleSettings settings;
33 
34  FileExtMismatchModuleSettingsPanel(FileExtMismatchDetectorModuleSettings settings) {
35  this.settings = settings;
36  initComponents();
37  customizeComponents();
38  }
39 
40  private void customizeComponents() {
41  switch (settings.getCheckType()) {
42  case ALL:
43  checkAllRadioButton.setSelected(true);
44  break;
45  case NO_TEXT_FILES:
46  checkNoTextRadioButton.setSelected(true);
47  break;
48  case ONLY_MEDIA_AND_EXE:
49  checkMediaExeRadioButton.setSelected(true);
50  break;
51  default:
52  checkMediaExeRadioButton.setSelected(true);
53  break;
54  }
55  skipNoExtCheckBox.setSelected(settings.skipFilesWithNoExtension());
56  skipKnownFiles.setSelected(settings.skipKnownFiles());
57  }
58 
59  @Override
60  public IngestModuleIngestJobSettings getSettings() {
61  return settings;
62  }
63 
69  @SuppressWarnings("unchecked")
70  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
71  private void initComponents() {
72 
73  checkTypeButtonGroup = new javax.swing.ButtonGroup();
74  skipNoExtCheckBox = new javax.swing.JCheckBox();
75  skipKnownFiles = new javax.swing.JCheckBox();
76  checkAllRadioButton = new javax.swing.JRadioButton();
77  checkNoTextRadioButton = new javax.swing.JRadioButton();
78  checkMediaExeRadioButton = new javax.swing.JRadioButton();
79 
80  skipNoExtCheckBox.setSelected(true);
81  skipNoExtCheckBox.setText(org.openide.util.NbBundle.getMessage(FileExtMismatchModuleSettingsPanel.class, "FileExtMismatchModuleSettingsPanel.skipNoExtCheckBox.text")); // NOI18N
82  skipNoExtCheckBox.addActionListener(new java.awt.event.ActionListener() {
83  public void actionPerformed(java.awt.event.ActionEvent evt) {
84  skipNoExtCheckBoxActionPerformed(evt);
85  }
86  });
87 
88  skipKnownFiles.setSelected(true);
89  skipKnownFiles.setText(org.openide.util.NbBundle.getMessage(FileExtMismatchModuleSettingsPanel.class, "FileExtMismatchModuleSettingsPanel.skipKnownFiles.text")); // NOI18N
90  skipKnownFiles.addActionListener(new java.awt.event.ActionListener() {
91  public void actionPerformed(java.awt.event.ActionEvent evt) {
92  skipKnownFilesActionPerformed(evt);
93  }
94  });
95 
96  checkTypeButtonGroup.add(checkAllRadioButton);
97  checkAllRadioButton.setText(org.openide.util.NbBundle.getMessage(FileExtMismatchModuleSettingsPanel.class, "FileExtMismatchModuleSettingsPanel.checkAllRadioButton.text")); // NOI18N
98  checkAllRadioButton.addActionListener(new java.awt.event.ActionListener() {
99  public void actionPerformed(java.awt.event.ActionEvent evt) {
100  checkAllRadioButtonActionPerformed(evt);
101  }
102  });
103 
104  checkTypeButtonGroup.add(checkNoTextRadioButton);
105  checkNoTextRadioButton.setText(org.openide.util.NbBundle.getMessage(FileExtMismatchModuleSettingsPanel.class, "FileExtMismatchModuleSettingsPanel.checkNoTextRadioButton.text")); // NOI18N
106  checkNoTextRadioButton.addActionListener(new java.awt.event.ActionListener() {
107  public void actionPerformed(java.awt.event.ActionEvent evt) {
108  checkNoTextRadioButtonActionPerformed(evt);
109  }
110  });
111 
112  checkTypeButtonGroup.add(checkMediaExeRadioButton);
113  checkMediaExeRadioButton.setText(org.openide.util.NbBundle.getMessage(FileExtMismatchModuleSettingsPanel.class, "FileExtMismatchModuleSettingsPanel.checkMediaExeRadioButton.text")); // NOI18N
114  checkMediaExeRadioButton.addActionListener(new java.awt.event.ActionListener() {
115  public void actionPerformed(java.awt.event.ActionEvent evt) {
116  checkMediaExeRadioButtonActionPerformed(evt);
117  }
118  });
119 
120  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
121  this.setLayout(layout);
122  layout.setHorizontalGroup(
123  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
124  .addGroup(layout.createSequentialGroup()
125  .addContainerGap()
126  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
127  .addComponent(checkAllRadioButton)
128  .addComponent(checkNoTextRadioButton)
129  .addComponent(checkMediaExeRadioButton)
130  .addComponent(skipNoExtCheckBox)
131  .addComponent(skipKnownFiles))
132  .addGap(0, 0, Short.MAX_VALUE))
133  );
134  layout.setVerticalGroup(
135  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
136  .addGroup(layout.createSequentialGroup()
137  .addContainerGap()
138  .addComponent(checkAllRadioButton)
139  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
140  .addComponent(checkNoTextRadioButton)
141  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
142  .addComponent(checkMediaExeRadioButton)
143  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
144  .addComponent(skipNoExtCheckBox)
145  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
146  .addComponent(skipKnownFiles)
147  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
148  );
149  }// </editor-fold>//GEN-END:initComponents
150 
151  private void skipNoExtCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_skipNoExtCheckBoxActionPerformed
152  settings.setSkipFilesWithNoExtension(skipNoExtCheckBox.isSelected());
153  }//GEN-LAST:event_skipNoExtCheckBoxActionPerformed
154 
155  private void skipKnownFilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_skipKnownFilesActionPerformed
156  settings.setSkipKnownFiles(skipKnownFiles.isSelected());
157  }//GEN-LAST:event_skipKnownFilesActionPerformed
158 
159  private void checkAllRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkAllRadioButtonActionPerformed
160  settings.setCheckType(FileExtMismatchDetectorModuleSettings.CHECK_TYPE.ALL);
161  }//GEN-LAST:event_checkAllRadioButtonActionPerformed
162 
163  private void checkNoTextRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkNoTextRadioButtonActionPerformed
164  settings.setCheckType(FileExtMismatchDetectorModuleSettings.CHECK_TYPE.NO_TEXT_FILES);
165  }//GEN-LAST:event_checkNoTextRadioButtonActionPerformed
166 
167  private void checkMediaExeRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkMediaExeRadioButtonActionPerformed
168  settings.setCheckType(FileExtMismatchDetectorModuleSettings.CHECK_TYPE.ONLY_MEDIA_AND_EXE);
169  }//GEN-LAST:event_checkMediaExeRadioButtonActionPerformed
170 
171  // Variables declaration - do not modify//GEN-BEGIN:variables
172  private javax.swing.JRadioButton checkAllRadioButton;
173  private javax.swing.JRadioButton checkMediaExeRadioButton;
174  private javax.swing.JRadioButton checkNoTextRadioButton;
175  private javax.swing.ButtonGroup checkTypeButtonGroup;
176  private javax.swing.JCheckBox skipKnownFiles;
177  private javax.swing.JCheckBox skipNoExtCheckBox;
178  // End of variables declaration//GEN-END:variables
179 }

Copyright © 2012-2018 Basis Technology. Generated on: Fri Mar 22 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.