RFC: Netx - Add support for filtering information based on os, arch and platform

Deepak Bhole dbhole at redhat.com
Wed Jun 24 11:07:47 PDT 2009


* Omair Majid <omajid at redhat.com> [2009-06-24 13:46]:
> Hi,
>
> The attached patch allows filtering the information elmenent in a jnlp  
> file based on the current os, arch and platform as well as the current  
> locale.
>
> This is mostly the same as the code in ResourceDesc, except for the  
> platform attribute. The jnlp programmer's guide [1] doesnt say what  
> platform is supposed to mean. However, the jnlp changelog [2] says it is  
> the 'os.platform' system property. This property isnt available in  
> either Sun's proprietary JDK or OpenJDK, so I added an extra check to  
> ignore the platform if System.getProperty("os.platform") returns a null.
>

Looks good. Assuming you have tested this, go ahead and apply.

Deepak

> ChangeLog:
> 2009-06-24  Omair Majid  <omajid at redhat.com>
>
>     * rt/net/sourceforge/jnlp/InformationDesc.java
>     Add os, arch and platform.
>     (InformationDesc): Accept os and arch parameters.
>     (getOS): New function.
>     (getArch): New function.
>     (getPlatform): New function.
>     * rt/net/sourceforge/jnlp/JNLPFile.java
>     Fix comments and add defaultPlatform. Update initializer to
>     initialize defaultPlatform.
>     (getInformation): Return the information section as filtered through
>     the default os, arch and platform as well as locale.
>     (getInformation): Filter information section through os, arch,
>     platform and locale.
>     (getResources): Call localeMatches instead of localMatches.
>     (setDefaults): Set the platform as well.
>     (localMatches): Renamed to...
>     (localeMatches): New function.
>     (stringMatches): New function.
>     * rt/net/sourceforge/jnlp/Parser.java
>     (getInformationDesc): Parse os, arch and platform attributes of the
>     information element.
>     * rt/net/sourceforge/jnlp/PluginBridge.java
>     (getInformation): Changed to take account of os, arch and platform
>     as well as the locale.
>
> Any comments?
>
> Cheers,
> Omair
>
> [1]  
> http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html
> [2]  
> http://jcp.org/aboutJava/communityprocess/maintenance/jsr056/jnlp_spec.html#4828991





More information about the distro-pkg-dev mailing list