james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r833437 - /james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/ServerModul.java
Date Fri, 06 Nov 2009 15:19:31 GMT
Author: norman
Date: Fri Nov  6 15:19:28 2009
New Revision: 833437

URL: http://svn.apache.org/viewvc?rev=833437&view=rev
Log:
Load config file

Modified:
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/ServerModul.java

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/ServerModul.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/ServerModul.java?rev=833437&r1=833436&r2=833437&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/ServerModul.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/ServerModul.java Fri
Nov  6 15:19:28 2009
@@ -69,16 +69,17 @@
 
     public static final String SYS_PROP_CONFIG_FILE = "hupa.config.file";
 
+    public static final String CONFIG_FILE_NAME = "config.properties";
     public static final String[] CONFIG_PROPERTIES = {
-            System.getenv("HOME") + "/.hupa/config.properties",
+            System.getenv("HOME") + "/.hupa/" + CONFIG_FILE_NAME,
             "/etc/default/hupa"
             };
-    public static final String CONF_DIR = "WEB-INF" + File.separator + "conf" + File.separator;
+    public static final String CONF_DIR = "WEB-INF/conf/";
 
     private String configDir;
     
     public ServerModul(String rootPath) {
-        configDir = rootPath + File.separator + CONF_DIR;
+        configDir = rootPath + "/" + CONF_DIR;
     }
 
     @Override
@@ -129,17 +130,20 @@
 
     protected Properties loadProperties() throws Exception {
         Properties properties = null;
-
-        String fileName = System.getProperty(SYS_PROP_CONFIG_FILE);
-        if (fileName != null) {
-            properties = loadProperties(fileName);
-        }
+        properties = loadProperties(configDir + CONFIG_FILE_NAME);
 
         if (properties == null) {
-            for (String name : CONFIG_PROPERTIES) {
-                properties = loadProperties(name);
-                if (properties != null)
-                    break;
+            String fileName = System.getProperty(SYS_PROP_CONFIG_FILE);
+            if (fileName != null) {
+                properties = loadProperties(fileName);
+            }
+
+            if (properties == null) {
+                for (String name : CONFIG_PROPERTIES) {
+                    properties = loadProperties(name);
+                    if (properties != null)
+                        break;
+                }
             }
         }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message