summaryrefslogtreecommitdiff
path: root/BKULocal/src
diff options
context:
space:
mode:
Diffstat (limited to 'BKULocal/src')
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java5
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSTALFactory.java9
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/PINManagementServlet.java7
3 files changed, 15 insertions, 6 deletions
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java
index ced47d6c..8730a611 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java
@@ -21,6 +21,7 @@ import java.awt.Desktop;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.net.URI;
+import java.net.URL;
import java.util.Locale;
import org.slf4j.Logger;
@@ -37,8 +38,8 @@ public class LocalHelpListener extends ViewerHelpListener {
protected Desktop desktop;
- public LocalHelpListener(String helpURL, Locale locale) {
- super(helpURL, locale);
+ public LocalHelpListener(URL baseURL, Locale locale) {
+ super(baseURL, locale);
if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
desktop = Desktop.getDesktop();
} else {
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSTALFactory.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSTALFactory.java
index 2c986d84..cc0d8fc2 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSTALFactory.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSTALFactory.java
@@ -19,6 +19,8 @@ package at.gv.egiz.bku.local.stal;
import at.gv.egiz.bku.viewer.ResourceFontLoader;
import java.awt.Dimension;
import java.awt.Toolkit;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.util.Locale;
@@ -46,7 +48,7 @@ public class LocalSTALFactory implements STALFactory {
private final Logger log = LoggerFactory.getLogger(LocalSTALFactory.class);
protected static final Dimension PREFERRED_SIZE = new Dimension(318, 200);
- protected String helpURL;
+ protected URL helpURL;
protected Locale locale;
protected Configuration configuration;
@@ -108,9 +110,10 @@ public class LocalSTALFactory implements STALFactory {
/**
* spring injects helpURL
* @param helpURL
+ * @throws MalformedURLException if helpURL is not a valid URL
*/
- public void setHelpURL(String helpURL) {
- this.helpURL = helpURL;
+ public void setHelpURL(String helpURL) throws MalformedURLException {
+ this.helpURL = new URL(helpURL);
}
/**
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/PINManagementServlet.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/PINManagementServlet.java
index ab41634e..1d079786 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/PINManagementServlet.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/PINManagementServlet.java
@@ -22,6 +22,7 @@ import at.gv.egiz.stal.STAL;
import at.gv.egiz.stal.STALResponse;
import at.gv.egiz.stal.ext.PINManagementRequest;
import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collections;
import java.util.List;
@@ -46,7 +47,11 @@ public class PINManagementServlet extends HttpServlet {
public PINManagementServlet() {
stalFactory = new LocalSTALFactory();
- stalFactory.setHelpURL("http://localhost:3495/help/");
+ try {
+ stalFactory.setHelpURL("http://localhost:3495/help/");
+ } catch (MalformedURLException e) {
+ log.info("Failed to set help URL.", e);
+ }
}
/**