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

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