xp-framework/xp-framework — pull request #179 by ohinckel (2012-07-31 06:21:17+00:00)
Title: Read configuration files from XAR archive

With this patch, it's now possible to read configuration files (INI files) from XAR archive. Internally the `ArchiveClassLoader` is used, which already provides the functionality to read resources from archives.

It introduces the following new classes:
* `util.ArchivePropertySource` - reads configuration from XAR archive using `ArchiveClassLoader`
* `util.PropertySourceFactory` - factory for creating different sources by their URI

Introducing property source factory
--------------------------------------------------
A new class named `util.PropertySourceFactory` is implemented which can be used to obtain the corrent property source implementation for a given URI.

The `PropertySourceFactory` currently supports the `FilesystemPropertySource`, which is used as default when no other property source is suitable, and the `ArchivePropertySource`, which is used when the URI ends with `.xar`.

Adjustments to the tools
-----------------------------------
The command runner and scriptlet runner are also adjusted to support both type of property sources by using the factory:
* for the command runner it's now possible to use `xpcli -c /path/to/archive.xar`
* for the scriptlet runner to set `prop-base="/path/to/archive.xar"`

... to read configuration from an archive.