cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chirad...@apache.org
Subject [11/19] git commit: updated refs/heads/quickcloud2 to 8166264
Date Fri, 05 Apr 2013 22:22:46 GMT
QuickCloud: also look for consoleproxy.properties using PropertiesUtil.
When executed with mvn exec:java, the path 'conf' is not on the classpath


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/46712c5c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/46712c5c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/46712c5c

Branch: refs/heads/quickcloud2
Commit: 46712c5c4f2b9d8c0445267192a397e3a2cf7e4b
Parents: 490db49
Author: Chiradeep Vittal <chiradeep@apache.org>
Authored: Tue Mar 26 10:06:46 2013 -0700
Committer: Chiradeep Vittal <chiradeep@apache.org>
Committed: Fri Apr 5 15:12:16 2013 -0700

----------------------------------------------------------------------
 .../src/com/cloud/consoleproxy/ConsoleProxy.java   |   16 +++++++++++++-
 1 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/46712c5c/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxy.java
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxy.java b/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxy.java
index b5c2989..2abce56 100644
--- a/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxy.java
+++ b/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxy.java
@@ -17,6 +17,8 @@
 package com.cloud.consoleproxy;
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.InputStream;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
@@ -34,6 +36,7 @@ import org.apache.commons.codec.binary.Base64;
 import org.apache.log4j.xml.DOMConfigurator;
 
 import com.cloud.consoleproxy.util.Logger;
+import com.cloud.utils.PropertiesUtil;
 import com.google.gson.Gson;
 import com.sun.net.httpserver.HttpServer;
 
@@ -282,8 +285,17 @@ public class ConsoleProxy {
         InputStream confs = ConsoleProxy.class.getResourceAsStream("/conf/consoleproxy.properties");
         Properties props = new Properties();
         if (confs == null) {
-            s_logger.info("Can't load consoleproxy.properties from classpath, will use default
configuration");
-        } else {
+            final File file = PropertiesUtil.findConfigFile("consoleproxy.properties");
+            if (file == null)
+                s_logger.info("Can't load consoleproxy.properties from classpath, will use
default configuration");
+            else
+                try {
+                    confs = new FileInputStream(file);
+                } catch (FileNotFoundException e) {
+                    s_logger.info("Ignoring file not found exception and using defaults");
+                }
+        } 
+        if (confs != null) {
             try {
                 props.load(confs);
                 


Mime
View raw message