19 package org.sleuthkit.autopsy.actions;
21 import java.awt.Desktop;
22 import java.awt.event.ActionEvent;
23 import java.awt.event.ActionListener;
25 import java.io.IOException;
26 import java.util.logging.Level;
27 import org.openide.DialogDisplayer;
28 import org.openide.NotifyDescriptor;
29 import org.openide.awt.ActionID;
30 import org.openide.awt.ActionReference;
31 import org.openide.awt.ActionRegistration;
32 import org.openide.modules.Places;
33 import org.openide.util.NbBundle;
46 @ActionRegistration(displayName =
"#CTL_OpenLogFolder", iconInMenu =
true)
47 @ActionReference(path =
"Menu/Help", position = 2000)
48 @ActionID(
id =
"org.sleuthkit.autopsy.actions.OpenLogFolderAction", category =
"Help")
68 logDir =
new File(Places.getUserDirectory().getAbsolutePath() + File.separator +
"var" + File.separator +
"log");
71 logDir =
new File(Places.getUserDirectory().getAbsolutePath() + File.separator +
"var" + File.separator +
"log");
75 if (logDir.exists()) {
76 Desktop.getDesktop().
open(logDir);
78 logger.log(Level.SEVERE, String.format(
"The log directory %s does not exist", logDir));
79 NotifyDescriptor notifyDescriptor =
new NotifyDescriptor.Message(
80 NbBundle.getMessage(
this.getClass(),
"OpenLogFolder.error1", logDir.getAbsolutePath()),
81 NotifyDescriptor.ERROR_MESSAGE);
82 DialogDisplayer.getDefault().notify(notifyDescriptor);
84 }
catch (IOException ex) {
85 logger.log(Level.SEVERE, String.format(
"Could not open log directory %s", logDir), ex);
86 NotifyDescriptor notifyDescriptor =
new NotifyDescriptor.Message(
87 NbBundle.getMessage(
this.getClass(),
"OpenLogFolder.CouldNotOpenLogFolder", logDir.getAbsolutePath()),
88 NotifyDescriptor.ERROR_MESSAGE);
89 DialogDisplayer.getDefault().notify(notifyDescriptor);
String getLogDirectoryPath()
Void open(ProgressIndicator progressIndicator, Object additionalParams)
synchronized static Logger getLogger(String name)
static Case getCurrentCaseThrows()
void actionPerformed(ActionEvent e)
static boolean isCaseOpen()