dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #00498
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 144: Made the LocationManager look for a system property, default to dhis2.home, if the environment va...
------------------------------------------------------------
revno: 144
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Thu 2009-04-02 13:32:07 +0200
message:
Made the LocationManager look for a system property, default to dhis2.home, if the environment variable is not set
modified:
dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/location/DefaultLocationManager.java
dhis-2/dhis-support/dhis-support-external/src/main/resources/META-INF/dhis/beans.xml
=== modified file 'dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/location/DefaultLocationManager.java'
--- dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/location/DefaultLocationManager.java 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/location/DefaultLocationManager.java 2009-04-02 11:32:07 +0000
@@ -59,6 +59,13 @@
this.environmentVariable = environmentVariable;
}
+ private String systemProperty;
+
+ public void setSystemProperty( String systemProperty )
+ {
+ this.systemProperty = systemProperty;
+ }
+
// -------------------------------------------------------------------------
// Init
// -------------------------------------------------------------------------
@@ -79,6 +86,22 @@
else
{
log.info( "Environment variable " + environmentVariable + " not set" );
+
+ path = System.getProperty( systemProperty );
+
+ if ( path != null )
+ {
+ log.info( "System property " + systemProperty + " points to " + path );
+
+ if ( directoryIsValid( new File( path ) ) )
+ {
+ externalDir = path;
+ }
+ }
+ else
+ {
+ log.info( "System proeprty " + systemProperty + " not set" );
+ }
}
}
=== modified file 'dhis-2/dhis-support/dhis-support-external/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-support/dhis-support-external/src/main/resources/META-INF/dhis/beans.xml 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-support/dhis-support-external/src/main/resources/META-INF/dhis/beans.xml 2009-04-02 11:32:07 +0000
@@ -8,6 +8,7 @@
class="org.hisp.dhis.external.location.DefaultLocationManager"
init-method="init">
<property name="environmentVariable" value="DHIS2_HOME"/>
+ <property name="systemProperty" value="dhis2.home"/>
</bean>
<bean id="org.hisp.dhis.external.configuration.ConfigurationManager"
--
Trunk
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.