From b1c8641a63a67e3c64d948f9e8dce5c01e11e2dd Mon Sep 17 00:00:00 2001 From: mcentner Date: Wed, 5 May 2010 15:29:01 +0000 Subject: Merged feature branch mocca-1.2.13-id@r724 back to trunk. git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@725 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../java/at/gv/egiz/bku/webstart/Launcher.java | 39 ++++++++++++++-------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java') diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java index ef7edef1..e1cdb657 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java @@ -11,7 +11,7 @@ import java.util.ResourceBundle; import javax.jnlp.UnavailableServiceException; -import com.sun.javaws.security.JavaWebStartSecurity; +//import com.sun.javaws.security.JavaWebStartSecurity; import java.awt.AWTException; import java.awt.Desktop; import java.awt.Image; @@ -88,11 +88,11 @@ public class Launcher implements BKUControllerInterface, ActionListener { URL cert = null; URL help = null; try { - http = new URL("http://localhost:" + Integer.getInteger(Container.HTTPS_PORT_PROPERTY, 3495).intValue()); - https = new URL("https://localhost:" + Integer.getInteger(Container.HTTPS_PORT_PROPERTY, 3496).intValue()); + http = new URL("http://localhost:" + Integer.getInteger(Container.HTTPS_PORT_PROPERTY, 3495).intValue() + '/'); + https = new URL("https://localhost:" + Integer.getInteger(Container.HTTPS_PORT_PROPERTY, 3496).intValue() + '/'); pin = new URL(http, "/PINManagement"); - cert = new URL(http, "/installCertificate"); - help = new URL(http, "/help"); + cert = new URL(http, "/ca.crt"); + help = new URL(http, "/help/"); } catch (MalformedURLException ex) { log.error("Failed to create URL.", ex); } finally { @@ -134,13 +134,15 @@ public class Launcher implements BKUControllerInterface, ActionListener { public Launcher() { log.info("Initializing Launcher"); - if (log.isTraceEnabled()) { - SecurityManager sm = System.getSecurityManager(); - if (sm instanceof JavaWebStartSecurity) { - System.setSecurityManager(new LogSecurityManager((JavaWebStartSecurity) sm)); - } - } + + // SocketPerm * required (DataURL), FilePermission * write (JFileChooser) required, + // jetty does not allow fine-grained permission config (codeBase?) + // ie. we don't need a security manager + log.trace("disabling (JNLP) security manager"); + System.setSecurityManager(null); + messages = ResourceBundle.getBundle(MESSAGES_RESOURCE, Locale.getDefault()); + //TODO replace with statusNotifier trayIcon = initTrayIcon(); } @@ -213,7 +215,7 @@ public class Launcher implements BKUControllerInterface, ActionListener { Image image = ImageIO.read(getClass().getResourceAsStream(iconResource)); PopupMenu popup = new PopupMenu(); - + MenuItem helpItem = new MenuItem(messages.getString(LABEL_HELP)); helpItem.addActionListener(this); helpItem.setActionCommand(HELP_COMMAND); @@ -237,6 +239,7 @@ public class Launcher implements BKUControllerInterface, ActionListener { popup.add(aboutItem); TrayIcon ti = new TrayIcon(image, messages.getString(TOOLTIP_DEFAULT), popup); + ti.setImageAutoSize(true); ti.addActionListener(this); tray.add(ti); return ti; @@ -301,7 +304,11 @@ public class Launcher implements BKUControllerInterface, ActionListener { } if (config.isCertRenewed()) { try { - browse(HTTP_SECURITY_LAYER_URL); + if ("".equals(messages.getLocale().getLanguage())) { + browse(HTTP_SECURITY_LAYER_URL); + } else { + browse(new URL(HTTP_SECURITY_LAYER_URL, messages.getLocale().getLanguage())); + } } catch (Exception ex) { log.error("failed to open system browser, install TLS certificate manually: " + HTTPS_SECURITY_LAYER_URL, ex); } @@ -364,7 +371,11 @@ public class Launcher implements BKUControllerInterface, ActionListener { } else if (HELP_COMMAND.equals(e.getActionCommand())) { log.debug("help page requested via tray menu"); try { - browse(HELP_URL); + if ("".equals(messages.getLocale().getLanguage())) { + browse(HELP_URL); + } else { + browse(new URL(HELP_URL, messages.getLocale().getLanguage())); + } } catch (Exception ex) { log.error("Failed to open " + HELP_URL, ex); String msg = MessageFormat.format(messages.getString(ERROR_OPEN_URL), HELP_URL); -- cgit v1.2.3