Go to the documentation of this file.
19package org.sleuthkit.autopsy.coreutils;
22import java.io.IOException;
24import java.util.concurrent.TimeUnit;
25import java.util.logging.Level;
26import org.apache.commons.lang3.SystemUtils;
42 if (SystemUtils.IS_OS_LINUX) {
44 xdgSupported = Runtime.getRuntime().exec(
new String[]{
"which",
"xdg-open"}).getInputStream().read() != -1;
45 }
catch (IOException ex) {
46 LOGGER.log(Level.WARNING,
"There was an error running 'which xdg-open' ", ex);
92 private void xdgOpen(String path)
throws IOException {
93 Process process = Runtime.getRuntime().exec(
new String[]{
"xdg-open", path});
96 }
catch (InterruptedException ex) {
97 throw new IOException(
"xdg-open timed out", ex);
99 int exitCode = process.exitValue();
101 throw new IOException(
"Received non-zero exit code from xdg-open: " + exitCode);
111 public void browse(URI uri)
throws IOException {
125 public void open(File file)
throws IOException {
127 xdgOpen(file.getAbsolutePath());
139 public void edit(File file)
throws IOException {
141 xdgOpen(file.getAbsolutePath());
static final Logger LOGGER
static Boolean xdgSupported
final java.awt.Desktop awtDesktop
void xdgOpen(String path)
Desktop(java.awt.Desktop awtDesktop)
static Desktop getDesktop()
static boolean isXdgSupported()
static final long XDG_TIMEOUT_SECS
static boolean isDesktopSupported()
synchronized static Logger getLogger(String name)
Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.