HughP / simal

Automatically exported from code.google.com/p/simal
0 stars 0 forks source link

Looks for local properties in more places #347

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We should also look for local.simal.properties in 
System.getProperty("user.home") which is much more predicatable.

The code for finding the file is at 
http://code.google.com/p/simal/source/browse/trunk/uk.ac.osswatch.simal.core/src
/main/java/uk/ac/osswatch/simal/SimalProperties.java#127

[reported by cmahnke...gmail.com]

Original issue reported on code.google.com by ross.gardler on 17 Sep 2010 at 9:50

GoogleCodeExporter commented 9 years ago
Please consider using a more elaborate mechanism for this, for deployment it's 
probably a good idea to take a environment variable (like SIMAL_HOME) into 
account as well:
If SIMAL_HOME is set, exists and is writeable use it, otherwise fall back to 
user.home and check again. Every check should be logged if it fails.

Original comment by cmah...@googlemail.com on 17 Sep 2010 at 10:06

GoogleCodeExporter commented 9 years ago
I like the suggestion of using the env variable SIMAL_HOME, because it allows 
for an easy configuration without needing to touch the war. 

When working on this, I noticed there are two issues here:

1) Finding the properties file "local.simal.properties" and where to look for 
it. This is where Ross refers to. I'll implement this by searching in 
SIMAL_HOME if set, otherwise in "user.home".

2) Defining a sensible default when no value of a property can be found, eg. 
for the location of the db. For the location of the database, as well as for 
the location of the backup directory, we first should check the property value 
set in the local.simal.properties. If this cannot be found, fall back onto 
SIMAL_HOME, otherwise "user.home".

Original comment by sander.v...@oucs.ox.ac.uk on 21 Sep 2010 at 1:06

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2043.

Original comment by sander.v...@oucs.ox.ac.uk on 22 Sep 2010 at 9:03