19 package org.sleuthkit.autopsy.casemodule;
21 import java.awt.Component;
22 import java.awt.event.ActionEvent;
23 import java.awt.event.ActionListener;
25 import java.util.logging.Level;
26 import javax.swing.JFileChooser;
27 import javax.swing.JOptionPane;
28 import javax.swing.filechooser.FileFilter;
29 import javax.swing.filechooser.FileNameExtensionFilter;
30 import org.openide.util.NbBundle;
31 import org.openide.util.lookup.ServiceProvider;
39 @ServiceProvider(service = CaseOpenAction.class)
43 private static final String PROP_BASECASE =
"LBL_BaseCase_PATH";
44 private final JFileChooser fc =
new JFileChooser();
51 autFilter =
new FileNameExtensionFilter(
53 Case.CASE_DOT_EXTENSION),
55 fc.setDragEnabled(
false);
56 fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
57 fc.setMultiSelectionEnabled(
false);
58 fc.setFileFilter(autFilter);
63 }
catch (Exception e) {
74 int retval = fc.showOpenDialog((Component) e.getSource());
76 if (retval == JFileChooser.APPROVE_OPTION) {
77 String path = fc.getSelectedFile().getPath();
78 String dirPath = fc.getSelectedFile().getParent();
81 if (!
new File(path).exists()) {
82 JOptionPane.showMessageDialog(null,
83 NbBundle.getMessage(
this.getClass(),
84 "CaseOpenAction.msgDlg.fileNotExist.msg"),
85 NbBundle.getMessage(
this.getClass(),
86 "CaseOpenAction.msgDlg.fileNotExist.title"),
87 JOptionPane.ERROR_MESSAGE);
88 this.actionPerformed(e);
93 }
catch (Exception ex) {
95 logger.log(Level.WARNING,
"Error closing startup window.", ex);
100 JOptionPane.showMessageDialog(null,
101 NbBundle.getMessage(
this.getClass(),
102 "CaseOpenAction.msgDlg.cantOpenCase.msg", path,
104 NbBundle.getMessage(
this.getClass(),
105 "CaseOpenAction.msgDlg.cantOpenCase.title"),
106 JOptionPane.ERROR_MESSAGE);
107 logger.log(Level.WARNING,
"Error opening case in folder " + path, ex);
static void open(String configFilePath)
void actionPerformed(ActionEvent e)
static synchronized void setConfigSetting(String moduleName, String settingName, String settingVal)
static String getConfigSetting(String moduleName, String settingName)
static final String MAIN_SETTINGS
static StartupWindowProvider getInstance()
static Logger getLogger(String name)