[icedtea-web] RFC: add support for validating the deployment configuration

Omair Majid omajid at redhat.com
Thu Dec 9 13:22:08 PST 2010


On 12/09/2010 03:43 PM, Deepak Bhole wrote:
> * Omair Majid<omajid at redhat.com>  [2010-12-09 12:12]:
>> Hi,
>>
>> The attached patch adds support for validating the deployment
>> configuration. This patch does not add any GUI or command line tools
>> to do it manually (that will be addressed later).
>>
>> What this patch does is reject invalid values in all deployment
>> configuration files and use the default ones. A
>> deployment.properties file like:
>> deployment.debug=foobar
>> deployment.user.cachedir=file:///localhost/
>> foo.bar=foo
>>
>> will make javaws detect the problems and use the default values instead:
>>
>> Unknown setting "deployment.debug"
>> Unknown setting "foo.bar"
>> Error: setting "deployment.user.cachedir" has incorrect value
>> "file:///localhost/". Using the default value
>> "/home/omajid/.icedtea/cache" instead. Possible values include the
>> absolute location of a file - it must begin with a /.
>>
>
> Looks okay to me. Not sure if we should be using a 'default' value
> instead though.. what does the reference impl. do?

Hm.. good point, I hadnt checked that. I have tried it out now, and here 
are my observations.

I tried adding a few malformed and invalid entries and it seems to run 
without any problems. I tried using a url as a cache location (which is 
not allowed) and I did not see any files being cached in the default 
location. As far as I can see, any invalid entries are silently ignored 
and some sane value (_not_ necessarily the default value) is substituted 
instead. In general, even with incorrect properties, javaws works - no 
error messages, nothing printed to the console and the invalid entries 
in the properties file are not modified.

If you like, I can leave out the part where incorrect values are 
replaced with default values (after all, everywhere in the code where a 
configuration is used, it is checked for being valid first)  - the rest 
of the validation is still useful for doing command line and GUI 
validation and informing the user.

The important thing, I suppose, is that we should somehow tell user that 
something is wrong, but still run all JNLPs and applets.

Thoughts?

Cheers,
Omair



More information about the distro-pkg-dev mailing list