private boolean browseImpl(URL url) throws DesktopException { final String prop = System.getProperty("paxle.desktop.jdic.browse", "default"); final BrowserService browserService = (BrowserService) ServiceManager.getService(ServiceManager.BROWSER_SERVICE); try { if (browserService .getClass() .getName() .equals("org.jdesktop.jdic.desktop.internal.impl.WinBrowserService")) { if (prop.equals("reflect")) { browseWinReflect(url); } else { // default if Windows browseWinRundll(url); } return true; } else { // default if other OS browserService.show(url); return true; } } catch (LaunchFailedException e) { final DesktopException ex = new DesktopException("Failed launching default browser"); ex.initCause(e); throw ex; } }
public boolean browse(URL url) { try { return browseImpl(url); } catch (DesktopException e) { if (logger.isDebugEnabled()) { logger.error("Backend error starting browser", e); } else { logger.error(e.getMessage()); } return false; } catch (LinkageError e) { logger.error("Linkage error starting browser: " + e.getMessage()); return false; } }