/hg/icedtea-web: Fix lookup of about.jnlp
omajid at icedtea.classpath.org
omajid at icedtea.classpath.org
Tue Feb 22 11:52:20 PST 2011
changeset 9dfc0ff64b70 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=9dfc0ff64b70
author: Omair Majid <omajid at redhat.com>
date: Tue Feb 22 14:51:52 2011 -0500
Fix lookup of about.jnlp
javaws -about was previously looking for about.jnlp in JAVA_HOME.
Since javaws is not meant to be installed in JAVA_HOME, this makes
no sense. This patch makes javaws use the about.jnlp inside netx.jar
(by loading it using the classloader).
2011-02-22 Omair Majid <omajid at redhat.com>
* netx/net/sourceforge/jnlp/resources/Messages.properties: Add
RNoAboutJnlp.
* netx/net/sourceforge/jnlp/runtime/Boot.java: Remove NETX_ABOUT_FILE.
(getAboutFile): Look for about.jnlp using the classloader.
(getFile): Use localized error message string.
diffstat:
3 files changed, 19 insertions(+), 10 deletions(-)
ChangeLog | 8 ++++++
netx/net/sourceforge/jnlp/resources/Messages.properties | 1
netx/net/sourceforge/jnlp/runtime/Boot.java | 20 +++++++--------
diffs (74 lines):
diff -r 87d12ebb7047 -r 9dfc0ff64b70 ChangeLog
--- a/ChangeLog Tue Feb 22 12:59:18 2011 -0500
+++ b/ChangeLog Tue Feb 22 14:51:52 2011 -0500
@@ -1,3 +1,11 @@ 2011-02-22 Omair Majid <omajid at redhat.
+2011-02-22 Omair Majid <omajid at redhat.com>
+
+ * netx/net/sourceforge/jnlp/resources/Messages.properties: Add
+ RNoAboutJnlp.
+ * netx/net/sourceforge/jnlp/runtime/Boot.java: Remove NETX_ABOUT_FILE.
+ (getAboutFile): Look for about.jnlp using the classloader.
+ (getFile): Use localized error message string.
+
2011-02-22 Omair Majid <omajid at redhat.com>
DJ Lucas <dj at lucasit.com>
diff -r 87d12ebb7047 -r 9dfc0ff64b70 netx/net/sourceforge/jnlp/resources/Messages.properties
--- a/netx/net/sourceforge/jnlp/resources/Messages.properties Tue Feb 22 12:59:18 2011 -0500
+++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Tue Feb 22 14:51:52 2011 -0500
@@ -121,6 +121,7 @@ PBadHeapSize=Invalid value for heap size
# Runtime
BLaunchAbout=Launching about window...
BNeedsFile=Must specify a .jnlp file
+RNoAboutJnlp=Unable to find about.jnlp
BFileLoc=JNLP file location
BArgNA=Arguments not used for this type of JNLP file (ignored).
BParamNA=Parameters not used for this type of JNLP file (ignored).
diff -r 87d12ebb7047 -r 9dfc0ff64b70 netx/net/sourceforge/jnlp/runtime/Boot.java
--- a/netx/net/sourceforge/jnlp/runtime/Boot.java Tue Feb 22 12:59:18 2011 -0500
+++ b/netx/net/sourceforge/jnlp/runtime/Boot.java Tue Feb 22 14:51:52 2011 -0500
@@ -109,10 +109,6 @@ public final class Boot implements Privi
+ " -Xclearcache " + R("BXclearcache") + "\n"
+ " -help " + R("BOHelp") + "\n";
- /** the JNLP file to open to display the network-based about window */
- private static final String NETX_ABOUT_FILE = System.getProperty("java.home") + File.separator + "lib"
- + File.separator + "about.jnlp";
-
private static final String doubleArgs = "-basedir -jnlp -arg -param -property -update";
private static String args[]; // avoid the hot potato
@@ -213,15 +209,19 @@ public final class Boot implements Privi
}
/**
- * Returns the about.jnlp file in {java.home}/lib or null if this file
+ * Returns the location of the about.jnlp file or null if this file
* does not exist.
*/
private static String getAboutFile() {
-
- if (new File(NETX_ABOUT_FILE).exists())
- return NETX_ABOUT_FILE;
- else
+ ClassLoader cl = Boot.class.getClassLoader();
+ if (cl == null) {
+ cl = ClassLoader.getSystemClassLoader();
+ }
+ try {
+ return cl.getResource("net/sourceforge/jnlp/resources/about.jnlp").toString();
+ } catch (Exception e) {
return null;
+ }
}
/**
@@ -236,7 +236,7 @@ public final class Boot implements Privi
if (getOption("-about") != null) {
location = getAboutFile();
if (location == null)
- fatalError("Unable to find about.jnlp in {java.home}/lib/");
+ fatalError(R("RNoAboutJnlp"));
} else {
location = getJNLPFile();
}
More information about the distro-pkg-dev
mailing list