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;
46 @ActionRegistration(displayName =
"#CTL_OpenOutputFolder", iconInMenu =
true, lazy =
false)
47 @ActionReference(path =
"Menu/Tools", position = 1850, separatorBefore = 1849)
48 @ActionID(
id =
"org.sleuthkit.autopsy.actions.OpenOutputFolderAction", category =
"Help")
51 private static final long serialVersionUID = 1L;
60 if (outputDir.exists()) {
62 Desktop.getDesktop().
open(outputDir);
63 }
catch (IOException ex) {
64 logger.log(Level.SEVERE, String.format(
"Failed to open output folder %s", outputDir), ex);
65 NotifyDescriptor descriptor =
new NotifyDescriptor.Message(
66 NbBundle.getMessage(
this.getClass(),
"OpenOutputFolder.CouldNotOpenOutputFolder", outputDir.getAbsolutePath()), NotifyDescriptor.ERROR_MESSAGE);
67 DialogDisplayer.getDefault().notify(descriptor);
70 NotifyDescriptor descriptor =
new NotifyDescriptor.Message(
71 NbBundle.getMessage(
this.getClass(),
"OpenOutputFolder.error1", outputDir.getAbsolutePath()), NotifyDescriptor.ERROR_MESSAGE);
72 DialogDisplayer.getDefault().notify(descriptor);
74 }
catch (IllegalStateException ex) {
75 logger.log(Level.SEVERE,
"OpenOutputFolderAction enabled with no current case", ex);
76 JOptionPane.showMessageDialog(null, NbBundle.getMessage(
this.getClass(),
"OpenOutputFolder.noCaseOpen"));
87 return HelpCtx.DEFAULT_HELP;
String getOutputDirectory()
static Case getCurrentCase()
synchronized static Logger getLogger(String name)
void open(Path caseMetadataFilePath)
static boolean isCaseOpen()