public void browseInFileSystemToFileOrDir(File fileOrDir) throws Exception {
        if (null == fileOrDir) {
            return;
        }

        try {

            Process process = executeFileSystemBrowserCommand(fileOrDir);
            if (null != process) {

                boolean waitFor = process.waitFor(2, TimeUnit.SECONDS);
                if (waitFor) {
                    //everything was fine
                    return;
                } else {
                    //fallback to Desktop.open()
                }
            }
        } catch (Exception e) {
            //execution via executeFileSystemBrowserCommand did not work, so fallback to Desktop.open()
        }

        if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) {
            try {
                File directory = fileOrDir.isDirectory() ? fileOrDir : fileOrDir.getParentFile();
                Desktop.getDesktop().open(directory);
            } catch (IOException e) {
                //NOP, no fallback anymore
            }
        }

    }