BaseXdb/basex — pull request #252 by malamut2 (2011-11-03 14:17:03+00:00)
Title: Home dir

Currently, BaseX will always automatically determine where the database files are residing. This is a nice feature, but it should be possible to overrule the automatic. For example, in my company, we have an internal policy that data of each service must reside in the directory /var/(companyname)/(servicename)/, which is of course not the directory where the actual application resides. I intend to write a service using BaseX, which is only possible if I can get BaseX to use that directory regardless of the work directory.

Since BaseX determines the directory at a very early stage of application life cycle (on class loading), it is not easily possible to create an API for controlling the directory. It is possible, however, to define a property which will be used to determine the directory if it is set. This can be achieved with just two simple additional lines in Util.homeDir(). I have preliminarily named the property 'basexdb.home'.