Autopsy  4.21.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
ImageFilePanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2021 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.casemodule;
20 
21 import java.io.File;
22 import java.util.Calendar;
23 import java.util.List;
24 import javax.swing.JFileChooser;
25 import javax.swing.JOptionPane;
26 import javax.swing.JPanel;
27 import javax.swing.JTextField;
28 import javax.swing.event.DocumentEvent;
29 import javax.swing.event.DocumentListener;
30 import javax.swing.filechooser.FileFilter;
31 import org.apache.commons.lang3.StringUtils;
32 import org.openide.util.NbBundle;
39 import org.sleuthkit.datamodel.HashUtility;
40 
46 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
47 public class ImageFilePanel extends JPanel implements DocumentListener {
48 
49  private static final long serialVersionUID = 1L;
50  private static final String PROP_LASTIMAGE_PATH = "LBL_LastImage_PATH"; //NON-NLS
51  private static final String[] SECTOR_SIZE_CHOICES = {"Auto Detect", "512", "1024", "2048", "4096"};
52  private final JFileChooserFactory fileChooserHelper = new JFileChooserFactory();
53  private JFileChooser fileChooser;
54  private final String contextName;
55  private final List<FileFilter> fileChooserFilters;
56 
65  private ImageFilePanel(String context, List<FileFilter> fileChooserFilters) {
66  this.contextName = context;
67  initComponents();
68 
69  // Populate the drop down list of time zones
70  createTimeZoneList();
71 
72  // Populate the drop down list of sector size options
73  for (String choice : SECTOR_SIZE_CHOICES) {
74  sectorSizeComboBox.addItem(choice);
75  }
76  sectorSizeComboBox.setSelectedIndex(0);
77 
78  errorLabel.setVisible(false);
79  this.fileChooserFilters = fileChooserFilters;
80  }
81 
86  private void createTimeZoneList() {
87  List<String> timeZoneList = TimeZoneUtils.createTimeZoneList();
88  for (String timeZone : timeZoneList) {
89  timeZoneComboBox.addItem(timeZone);
90  }
91 
92  // set the selected timezone
93  timeZoneComboBox.setSelectedItem(TimeZoneUtils.createTimeZoneString(Calendar.getInstance().getTimeZone()));
94  }
95 
106  public static synchronized ImageFilePanel createInstance(String context, List<FileFilter> fileChooserFilters) {
107  ImageFilePanel instance = new ImageFilePanel(context, fileChooserFilters);
108  // post-constructor initialization of listener support without leaking references of uninitialized objects
109  instance.getPathTextField().getDocument().addDocumentListener(instance);
110  instance.getMd5TextFieldField().getDocument().addDocumentListener(instance);
111  instance.getSha1TextField().getDocument().addDocumentListener(instance);
112  instance.getSha256TextField().getDocument().addDocumentListener(instance);
113  return instance;
114  }
115 
116  private JTextField getPathTextField() {
117  return pathTextField;
118  }
119 
120  private JTextField getMd5TextFieldField() {
121  return md5HashTextField;
122  }
123 
124  private JTextField getSha1TextField() {
125  return sha1HashTextField;
126  }
127 
128  private JTextField getSha256TextField() {
129  return sha256HashTextField;
130  }
131 
132  private JFileChooser getChooser() {
133  if(fileChooser == null) {
134  fileChooser = fileChooserHelper.getChooser();
135  fileChooser.setDragEnabled(false);
136  fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
137  fileChooser.setMultiSelectionEnabled(false);
138  fileChooserFilters.forEach(fileChooser::addChoosableFileFilter);
139  if (fileChooserFilters.isEmpty() == false) {
140  fileChooser.setFileFilter(fileChooserFilters.get(0));
141  }
142  }
143 
144  return fileChooser;
145  }
146 
152  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
153  private void initComponents() {
154 
155  pathLabel = new javax.swing.JLabel();
156  browseButton = new javax.swing.JButton();
157  pathTextField = new javax.swing.JTextField();
158  timeZoneLabel = new javax.swing.JLabel();
159  timeZoneComboBox = new javax.swing.JComboBox<>();
160  noFatOrphansCheckbox = new javax.swing.JCheckBox();
161  errorLabel = new javax.swing.JLabel();
162  sectorSizeLabel = new javax.swing.JLabel();
163  sectorSizeComboBox = new javax.swing.JComboBox<>();
164  sha256HashLabel = new javax.swing.JLabel();
165  sha256HashTextField = new javax.swing.JTextField();
166  sha1HashTextField = new javax.swing.JTextField();
167  md5HashTextField = new javax.swing.JTextField();
168  sha1HashLabel = new javax.swing.JLabel();
169  md5HashLabel = new javax.swing.JLabel();
170  hashValuesLabel = new javax.swing.JLabel();
171  hashValuesNoteLabel = new javax.swing.JLabel();
172 
173  setMinimumSize(new java.awt.Dimension(0, 65));
174  setPreferredSize(new java.awt.Dimension(403, 65));
175 
176  org.openide.awt.Mnemonics.setLocalizedText(pathLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.pathLabel.text")); // NOI18N
177 
178  org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.browseButton.text")); // NOI18N
179  browseButton.addActionListener(new java.awt.event.ActionListener() {
180  public void actionPerformed(java.awt.event.ActionEvent evt) {
181  browseButtonActionPerformed(evt);
182  }
183  });
184 
185  pathTextField.setText(org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.pathTextField.text")); // NOI18N
186 
187  org.openide.awt.Mnemonics.setLocalizedText(timeZoneLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.timeZoneLabel.text")); // NOI18N
188 
189  timeZoneComboBox.setMaximumRowCount(30);
190 
191  org.openide.awt.Mnemonics.setLocalizedText(noFatOrphansCheckbox, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.noFatOrphansCheckbox.text")); // NOI18N
192  noFatOrphansCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.noFatOrphansCheckbox.toolTipText")); // NOI18N
193 
194  errorLabel.setForeground(new java.awt.Color(255, 0, 0));
195  org.openide.awt.Mnemonics.setLocalizedText(errorLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.errorLabel.text")); // NOI18N
196 
197  org.openide.awt.Mnemonics.setLocalizedText(sectorSizeLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.sectorSizeLabel.text")); // NOI18N
198 
199  org.openide.awt.Mnemonics.setLocalizedText(sha256HashLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.sha256HashLabel.text")); // NOI18N
200  sha256HashLabel.setEnabled(false);
201 
202  sha256HashTextField.setText(org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.sha256HashTextField.text")); // NOI18N
203  sha256HashTextField.setEnabled(false);
204 
205  sha1HashTextField.setText(org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.sha1HashTextField.text")); // NOI18N
206  sha1HashTextField.setEnabled(false);
207 
208  md5HashTextField.setText(org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.md5HashTextField.text")); // NOI18N
209  md5HashTextField.setEnabled(false);
210 
211  org.openide.awt.Mnemonics.setLocalizedText(sha1HashLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.sha1HashLabel.text")); // NOI18N
212  sha1HashLabel.setEnabled(false);
213 
214  org.openide.awt.Mnemonics.setLocalizedText(md5HashLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.md5HashLabel.text")); // NOI18N
215  md5HashLabel.setEnabled(false);
216 
217  org.openide.awt.Mnemonics.setLocalizedText(hashValuesLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.hashValuesLabel.text")); // NOI18N
218  hashValuesLabel.setEnabled(false);
219 
220  org.openide.awt.Mnemonics.setLocalizedText(hashValuesNoteLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.hashValuesNoteLabel.text")); // NOI18N
221  hashValuesNoteLabel.setEnabled(false);
222 
223  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
224  this.setLayout(layout);
225  layout.setHorizontalGroup(
226  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
227  .addGroup(layout.createSequentialGroup()
228  .addComponent(pathTextField)
229  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
230  .addComponent(browseButton)
231  .addGap(2, 2, 2))
232  .addGroup(layout.createSequentialGroup()
233  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
234  .addComponent(pathLabel)
235  .addComponent(noFatOrphansCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE))
236  .addGap(0, 368, Short.MAX_VALUE))
237  .addGroup(layout.createSequentialGroup()
238  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
239  .addComponent(errorLabel)
240  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
241  .addGroup(layout.createSequentialGroup()
242  .addComponent(timeZoneLabel)
243  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
244  .addComponent(timeZoneComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 455, javax.swing.GroupLayout.PREFERRED_SIZE))
245  .addGroup(layout.createSequentialGroup()
246  .addComponent(sectorSizeLabel)
247  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
248  .addComponent(sectorSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 455, javax.swing.GroupLayout.PREFERRED_SIZE))
249  .addGroup(layout.createSequentialGroup()
250  .addComponent(md5HashLabel)
251  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
252  .addComponent(md5HashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 455, javax.swing.GroupLayout.PREFERRED_SIZE))
253  .addGroup(layout.createSequentialGroup()
254  .addComponent(sha1HashLabel)
255  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
256  .addComponent(sha1HashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 455, javax.swing.GroupLayout.PREFERRED_SIZE))
257  .addGroup(layout.createSequentialGroup()
258  .addComponent(sha256HashLabel)
259  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
260  .addComponent(sha256HashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 455, javax.swing.GroupLayout.PREFERRED_SIZE)))
261  .addComponent(hashValuesNoteLabel)
262  .addComponent(hashValuesLabel))
263  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
264  );
265  layout.setVerticalGroup(
266  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
267  .addGroup(layout.createSequentialGroup()
268  .addComponent(pathLabel)
269  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
270  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
271  .addComponent(browseButton)
272  .addComponent(pathTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
273  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
274  .addComponent(noFatOrphansCheckbox)
275  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
276  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
277  .addComponent(timeZoneComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
278  .addComponent(timeZoneLabel))
279  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
280  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
281  .addComponent(sectorSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
282  .addComponent(sectorSizeLabel))
283  .addGap(39, 39, 39)
284  .addComponent(hashValuesLabel)
285  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
286  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
287  .addComponent(md5HashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
288  .addComponent(md5HashLabel))
289  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
290  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
291  .addComponent(sha1HashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
292  .addComponent(sha1HashLabel))
293  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
294  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
295  .addComponent(sha256HashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
296  .addComponent(sha256HashLabel))
297  .addGap(18, 18, 18)
298  .addComponent(hashValuesNoteLabel)
299  .addGap(18, 18, 18)
300  .addComponent(errorLabel)
301  .addContainerGap(51, Short.MAX_VALUE))
302  );
303  }// </editor-fold>//GEN-END:initComponents
304 
305  @NbBundle.Messages({"ImageFilePanel.000.confirmationMessage=The selected file"
306  + " has extenson .001 but there is a .000 file in the sequence of raw images."
307  + "\nShould the .000 file be used as the start, instead of the selected .001 file?\n"})
308  private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed
309  String oldText = getContentPaths();
310  // set the current directory of the FileChooser if the ImagePath Field is valid
311  File currentDir = new File(oldText);
312  JFileChooser chooser = getChooser();
313  if (currentDir.exists()) {
314  chooser.setCurrentDirectory(currentDir);
315  }
316 
317  if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
318  String path = chooser.getSelectedFile().getPath();
319  if (path.endsWith(".001")) {
320  String zeroX3_path = StringUtils.removeEnd(path, ".001") + ".000";
321  if (new File(zeroX3_path).exists()) {
322  int showConfirmDialog = JOptionPane.showConfirmDialog(this,
323  Bundle.ImageFilePanel_000_confirmationMessage(),
324  "Choose .001 file?", JOptionPane.YES_NO_OPTION);
325  if (showConfirmDialog == JOptionPane.YES_OPTION) {
326  path = zeroX3_path;
327  }
328  }
329  }
330 
331  setContentPath(path);
332 
337  if (!oldText.equals(getContentPaths())) {
338  md5HashTextField.setText(null);
339  sha1HashTextField.setText(null);
340  sha256HashTextField.setText(null);
341  }
342  }
343 
344  updateHelper();
345  }//GEN-LAST:event_browseButtonActionPerformed
346 
347  // Variables declaration - do not modify//GEN-BEGIN:variables
348  private javax.swing.JButton browseButton;
349  private javax.swing.JLabel errorLabel;
350  private javax.swing.JLabel hashValuesLabel;
351  private javax.swing.JLabel hashValuesNoteLabel;
352  private javax.swing.JLabel md5HashLabel;
353  private javax.swing.JTextField md5HashTextField;
354  private javax.swing.JCheckBox noFatOrphansCheckbox;
355  private javax.swing.JLabel pathLabel;
356  private javax.swing.JTextField pathTextField;
357  private javax.swing.JComboBox<String> sectorSizeComboBox;
358  private javax.swing.JLabel sectorSizeLabel;
359  private javax.swing.JLabel sha1HashLabel;
360  private javax.swing.JTextField sha1HashTextField;
361  private javax.swing.JLabel sha256HashLabel;
362  private javax.swing.JTextField sha256HashTextField;
363  private javax.swing.JComboBox<String> timeZoneComboBox;
364  private javax.swing.JLabel timeZoneLabel;
365  // End of variables declaration//GEN-END:variables
366 
372  private void setHashValuesComponentsEnabled(boolean enabled) {
373  hashValuesLabel.setEnabled(enabled);
374  hashValuesNoteLabel.setEnabled(enabled);
375 
376  md5HashLabel.setEnabled(enabled);
377  md5HashTextField.setEnabled(enabled);
378 
379  sha1HashLabel.setEnabled(enabled);
380  sha1HashTextField.setEnabled(enabled);
381 
382  sha256HashLabel.setEnabled(enabled);
383  sha256HashTextField.setEnabled(enabled);
384  }
385 
391  public String getContentPaths() {
392  return pathTextField.getText();
393  }
394 
400  public void setContentPath(String s) {
401  pathTextField.setText(s);
402  }
403 
409  public int getSectorSize() {
410  int sectorSizeSelectionIndex = sectorSizeComboBox.getSelectedIndex();
411 
412  if (sectorSizeSelectionIndex == 0) {
413  return 0;
414  }
415 
416  return Integer.valueOf((String) sectorSizeComboBox.getSelectedItem());
417  }
418 
419  public String getTimeZone() {
420  String tz = timeZoneComboBox.getSelectedItem().toString();
421  return tz.substring(tz.indexOf(')') + 2).trim();
422  }
423 
424  public boolean getNoFatOrphans() {
425  return noFatOrphansCheckbox.isSelected();
426  }
427 
428  String getMd5() {
429  return this.md5HashTextField.getText();
430  }
431 
432  String getSha1() {
433  return this.sha1HashTextField.getText();
434  }
435 
436  String getSha256() {
437  return this.sha256HashTextField.getText();
438  }
439 
440  public void reset() {
441  //reset the UI elements to default
442  pathTextField.setText(null);
443  this.md5HashTextField.setText(null);
444  this.sha1HashTextField.setText(null);
445  this.sha256HashTextField.setText(null);
446  }
447 
453  @NbBundle.Messages({
454  "ImageFilePanel.validatePanel.dataSourceOnCDriveError=Warning: Path to multi-user data source is on \"C:\" drive",
455  "ImageFilePanel.validatePanel.invalidMD5=Invalid MD5 hash",
456  "ImageFilePanel.validatePanel.invalidSHA1=Invalid SHA1 hash",
457  "ImageFilePanel.validatePanel.invalidSHA256=Invalid SHA256 hash",})
458  public boolean validatePanel() {
459  errorLabel.setVisible(false);
460 
461  String path = getContentPaths();
462  if (!isImagePathValid()) {
463  return false;
464  }
465 
466  if (!StringUtils.isBlank(getMd5()) && !HashUtility.isValidMd5Hash(getMd5())) {
467  errorLabel.setVisible(true);
468  errorLabel.setText(Bundle.ImageFilePanel_validatePanel_invalidMD5());
469  return false;
470  }
471 
472  if (!StringUtils.isBlank(getSha1()) && !HashUtility.isValidSha1Hash(getSha1())) {
473  errorLabel.setVisible(true);
474  errorLabel.setText(Bundle.ImageFilePanel_validatePanel_invalidSHA1());
475  return false;
476  }
477 
478  if (!StringUtils.isBlank(getSha256()) && !HashUtility.isValidSha256Hash(getSha256())) {
479  errorLabel.setVisible(true);
480  errorLabel.setText(Bundle.ImageFilePanel_validatePanel_invalidSHA256());
481  return false;
482  }
483 
485  errorLabel.setVisible(true);
486  errorLabel.setText(Bundle.ImageFilePanel_validatePanel_dataSourceOnCDriveError());
487  }
488 
489  return true;
490  }
491 
492  private boolean isImagePathValid() {
493  String path = getContentPaths();
494 
495  if (StringUtils.isBlank(path) || (!(new File(path).isFile() || DriveUtils.isPhysicalDrive(path) || DriveUtils.isPartition(path)))) {
496  return false;
497  }
498 
499  return true;
500  }
501 
502  public void storeSettings() {
503  String imagePathName = getContentPaths();
504  if (null != imagePathName) {
505  String imagePath = imagePathName.substring(0, imagePathName.lastIndexOf(File.separator) + 1);
506  ModuleSettings.setConfigSetting(contextName, PROP_LASTIMAGE_PATH, imagePath);
507  }
508  }
509 
510  public void readSettings() {
511  String lastImagePath = ModuleSettings.getConfigSetting(contextName, PROP_LASTIMAGE_PATH);
512  if (StringUtils.isNotBlank(lastImagePath)) {
513  setContentPath(lastImagePath);
514  }
515  }
516 
517  @Override
518  public void insertUpdate(DocumentEvent e) {
519  updateHelper();
520  }
521 
522  @Override
523  public void removeUpdate(DocumentEvent e) {
524  updateHelper();
525  }
526 
527  @Override
528  public void changedUpdate(DocumentEvent e) {
529  updateHelper();
530  }
531 
538  @NbBundle.Messages({"ImageFilePanel.moduleErr=Module Error",
539  "ImageFilePanel.moduleErr.msg=A module caused an error listening to ImageFilePanel updates."
540  + " See log to determine which module. Some data could be incomplete.\n"})
541  private void updateHelper() {
542  if (isImagePathValid() && !getContentPaths().toLowerCase().endsWith(".e01")) {
543  setHashValuesComponentsEnabled(true);
544  } else {
545  setHashValuesComponentsEnabled(false);
546  }
547 
548  firePropertyChange(DataSourceProcessor.DSP_PANEL_EVENT.UPDATE_UI.toString(), false, true);
549  }
550 
554  public void select() {
555  pathTextField.requestFocusInWindow();
556  }
557 }
static synchronized String getConfigSetting(String moduleName, String settingName)
static boolean isPhysicalDrive(String path)
Definition: DriveUtils.java:43
javax.swing.JComboBox< String > sectorSizeComboBox
static synchronized ImageFilePanel createInstance(String context, List< FileFilter > fileChooserFilters)
static boolean isValidForCaseType(String path, Case.CaseType caseType)
static String createTimeZoneString(TimeZone timeZone)
void browseButtonActionPerformed(java.awt.event.ActionEvent evt)
static synchronized void setConfigSetting(String moduleName, String settingName, String settingVal)
ImageFilePanel(String context, List< FileFilter > fileChooserFilters)
javax.swing.JComboBox< String > timeZoneComboBox
static boolean isPartition(String path)
Definition: DriveUtils.java:54

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