[icedtea-web] RFC: fix lookup of about.jnlp
Deepak Bhole
dbhole at redhat.com
Tue Feb 22 11:18:16 PST 2011
* Omair Majid <omajid at redhat.com> [2011-02-22 14:15]:
> Hi,
>
> The fix to isolate icedtea-web in a non-JDK directory has resulted
> in javaws -about being broken. This is because javaws still looks
> for about.jnlp in the JDK directory. The attached patch fixes it by
> making netx use the about.jnlp that's included in netx.jar.
>
> I am not sure if this is the best fix; IcedTea-Web installs a
> separate about.jnlp in $(datadir)/icedtea-web/ which should be used
> instead.
>
> Ok to commit?
>
Since we are using an in-jar jnlp, how does this affect lookup of
about.jar?
Deepak
> Cheers,
> Omair
> diff -r 87d12ebb7047 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:04:28 2011 -0500
> @@ -121,6 +121,7 @@
> # 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 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:04:28 2011 -0500
> @@ -109,10 +109,6 @@
> + " -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 @@
> }
>
> /**
> - * 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 @@
> 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