Thursday, March 24, 2005

Hiding things from final users

Yesterday I had a surprise. Part of the application I was working on suddenly changed its aspect.
It was because some "smart" figured out what are those .jpg and .xml files that were dongling in a directory called res. So he modified them in a almost funny way.
It is nice for an application to offer some sknins or look&feels, but when those can be so easily modified and the whole application is messed up you start to think about it.
An obvious solution was to hide the resources in a container that can be sealed and distributed safely. So I did. I have made a whole archive with the resource files and modified the sources to ask for a certain resource not from the filesystem but from the archive instead by the means of a ResorceProvider class.
Another good thing happened as a result of this. Now my application is made only from jar files and is quite easy to distribute it to the users by the means of Java Webstart/JNLP.

Hourray !

No comments:

Post a Comment