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

Omair Majid omajid at redhat.com
Wed Jun 24 10:45:35 PDT 2009


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.

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: netx-infodes-os-arch-platform.patch
Type: text/x-patch
Size: 8873 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090624/4647713b/netx-infodes-os-arch-platform.patch 


More information about the distro-pkg-dev mailing list