19 package org.sleuthkit.autopsy.actions;
21 import java.awt.Desktop;
23 import java.io.IOException;
24 import java.util.logging.Level;
25 import javax.swing.JOptionPane;
26 import org.openide.DialogDisplayer;
27 import org.openide.NotifyDescriptor;
28 import org.openide.awt.ActionID;
29 import org.openide.awt.ActionReference;
30 import org.openide.awt.ActionRegistration;
31 import org.openide.util.HelpCtx;
32 import org.openide.util.NbBundle;
33 import org.openide.util.actions.CallableSystemAction;
34 import org.openide.windows.WindowManager;
48 @ActionRegistration(displayName =
"#CTL_OpenOutputFolder", iconInMenu =
true, lazy =
false)
49 @ActionReference(path =
"Menu/Tools", position = 1900, separatorBefore = 1899)
50 @ActionID(
id =
"org.sleuthkit.autopsy.actions.OpenOutputFolderAction", category =
"Help")
53 private static final long serialVersionUID = 1L;
62 if (outputDir.exists()) {
64 Desktop.getDesktop().
open(outputDir);
65 }
catch (IOException ex) {
66 logger.log(Level.SEVERE, String.format(
"Failed to open output folder %s", outputDir), ex);
67 NotifyDescriptor descriptor =
new NotifyDescriptor.Message(
68 NbBundle.getMessage(
this.getClass(),
"OpenOutputFolder.CouldNotOpenOutputFolder", outputDir.getAbsolutePath()), NotifyDescriptor.ERROR_MESSAGE);
69 DialogDisplayer.getDefault().notify(descriptor);
72 NotifyDescriptor descriptor =
new NotifyDescriptor.Message(
73 NbBundle.getMessage(
this.getClass(),
"OpenOutputFolder.error1", outputDir.getAbsolutePath()), NotifyDescriptor.ERROR_MESSAGE);
74 DialogDisplayer.getDefault().notify(descriptor);
77 logger.log(Level.SEVERE,
"OpenOutputFolderAction enabled with no current case", ex);
78 JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), NbBundle.getMessage(this.getClass(),
"OpenOutputFolder.noCaseOpen"));
89 return HelpCtx.DEFAULT_HELP;
Void open(ProgressIndicator progressIndicator, Object additionalParams)
String getOutputDirectory()
synchronized static Logger getLogger(String name)
static Case getCurrentCaseThrows()
static boolean isCaseOpen()