[jsword-devel] Overrides of resources

DM Smith jsword-devel@crosswire.org
Thu, 01 Apr 2004 13:24:45 -0500


I found out that changing the classpath ( system property: java.class.path) 
inside of the program does not work.

Since the idea was to add ~/.jsword as the first element in the classpath so 
that resources in jar files could be overridden, a solution was fairly 
simple:

In ResourceUtil add a static member URL home with appropriate set and get.
In getResource(String search) look at home first.
If the URL for search in home exists and is readable, then return it.
Otherwise continue as before.

The Project classes constructor would be responsible for creating the home 
URL and setting it in ResourceUtil.

This allows for all resources gotten via ResourceUtil and held in jars to be 
overridden.

This will allow developers to expand (part or all of) the resource.jar in 
the ~/.jsword directory and modify it to their hearts content.

_________________________________________________________________
Find a broadband plan that fits. Great local deals on high-speed Internet 
access. 
https://broadband.msn.com/?pgmarket=en-us/go/onm00200360ave/direct/01/