summaryrefslogtreecommitdiff
path: root/BKUApplet
diff options
context:
space:
mode:
authorTobias Kellner <tobias.kellner@iaik.tugraz.at>2015-01-12 18:59:30 +0100
committerTobias Kellner <tobias.kellner@iaik.tugraz.at>2015-02-04 03:49:11 +0100
commit27ed0a72faaa85ba456a24c8292735bbe2fa82ab (patch)
tree0368d8206375b8eea3a2f6ed21aeb9ce8f98b7fb /BKUApplet
parentdd2338aac4651c1bfea45c6b725d923fda903d04 (diff)
downloadmocca-27ed0a72faaa85ba456a24c8292735bbe2fa82ab.tar.gz
mocca-27ed0a72faaa85ba456a24c8292735bbe2fa82ab.tar.bz2
mocca-27ed0a72faaa85ba456a24c8292735bbe2fa82ab.zip
JarLocation fix
Diffstat (limited to 'BKUApplet')
-rw-r--r--BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
index 8ae1471b..46ee4102 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
@@ -31,6 +31,7 @@ import java.awt.Container;
import java.awt.Point;
import java.io.IOException;
import java.net.MalformedURLException;
+import java.net.URISyntaxException;
import java.net.URL;
import java.security.AccessController;
import java.security.AllPermission;
@@ -58,6 +59,7 @@ import at.gv.egiz.bku.gui.BKUGUIImpl;
import at.gv.egiz.bku.gui.HelpListener;
import at.gv.egiz.bku.gui.viewer.FontProvider;
import at.gv.egiz.bku.online.applet.viewer.URLFontLoader;
+import at.gv.egiz.bku.utils.JarLocation;
import at.gv.egiz.smcc.SignatureCardFactory;
import at.gv.egiz.stal.service.STALPortType;
import at.gv.egiz.stal.service.STALService;
@@ -107,8 +109,8 @@ public class BKUApplet extends JApplet {
String tmp = UNKNOWN_VERSION;
Logger log = LoggerFactory.getLogger(BKUApplet.class);
try {
- String BKUAppletJar = BKUApplet.class.getProtectionDomain().getCodeSource().getLocation().toString();
- URL manifestURL = new URL("jar:" + BKUAppletJar + "!/META-INF/MANIFEST.MF");
+ String bKUAppletJar = JarLocation.get(BKUApplet.class);
+ URL manifestURL = new URL("jar:" + bKUAppletJar + "!/META-INF/MANIFEST.MF");
log.trace("Read version information from {}.", manifestURL);
Manifest manifest = new Manifest(manifestURL.openStream());
Attributes atts = manifest.getMainAttributes();
@@ -117,6 +119,8 @@ public class BKUApplet extends JApplet {
}
} catch (IOException ex) {
log.error("Failed to read version.", ex);
+ } catch (URISyntaxException ex) {
+ log.error("Failed to read version.", ex);
} finally {
VERSION = tmp;
log.debug("BKU Applet {}.", VERSION);