Hey,

I've just made some changes to the FileConfiguration service which I hope will make it a bit more flexible in how the directories for an application is decided.

Basically, whereas before the directories could be parameterized using the MessageFormat patterns ("{1}/.{0}/mydir") it now instead uses a parameter evaluation algorithm based on names. Here's some examples:
# Get HOME from environment variables
configuration={environment.HOME}/Library/Preferences/{application}

# Get user.home from system properties
data={system.user.home}/Library/Application Support/{application}
temporary={temp}/{application}
cache={user}/Library/Caches/{application}
log={user}/Library/Logs/{application}

You get access to "user","temp","application", and then all environment variables and all system properties. Resolution is done recursively, so if you for example do this in the FileConfiguration properties bundle:
data={environment.MY_APP_HOME}/data

and then set the environment variable MY_APP_HOME to "{user}/{application}" then the data directory ends up being e.g. "/Users/rickard/MyApp/data".

I think this makes it a whole lot easier to use, and opens up for the popular XYZ_HOME style of defining where the install dir is. Marc's example of getting "Qi4j" into all install dir names should also be possible this way, if so desired, either by putting it into the bundle, or into a XYZ_HOME style environment variable that is evaluated.

Comments/improvements/issues?

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to