Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CAE5EFD47 for ; Tue, 26 Mar 2013 17:10:24 +0000 (UTC) Received: (qmail 52349 invoked by uid 500); 26 Mar 2013 17:10:24 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 52320 invoked by uid 500); 26 Mar 2013 17:10:24 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 52168 invoked by uid 99); 26 Mar 2013 17:10:23 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Mar 2013 17:10:23 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 95BB3820ED3; Tue, 26 Mar 2013 17:10:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chiradeep@apache.org To: commits@cloudstack.apache.org Date: Tue, 26 Mar 2013 17:10:28 -0000 Message-Id: <03b518ea955946b38accc2717197cf79@git.apache.org> In-Reply-To: <7569dbf32b424c11845338c96e38d4b4@git.apache.org> References: <7569dbf32b424c11845338c96e38d4b4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [6/6] git commit: refs/heads/quickcloud - QuickCloud: also look for consoleproxy.properties using PropertiesUtil. When executed with mvn exec:java, the path 'conf' is not on the classpath 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/841a8570 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/841a8570 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/841a8570 Branch: refs/heads/quickcloud Commit: 841a8570e2c2cab54c871ab6150b3cba6ca1923b Parents: e2fdd72 Author: Chiradeep Vittal Authored: Tue Mar 26 10:06:46 2013 -0700 Committer: Chiradeep Vittal Committed: Tue Mar 26 10:06:46 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/841a8570/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);