You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2015/01/27 20:47:50 UTC

svn commit: r1655138 - /qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java

Author: rgodfrey
Date: Tue Jan 27 19:47:49 2015
New Revision: 1655138

URL: http://svn.apache.org/r1655138
Log:
QPID-6339 : Use variable interpolation for help url and initial virtual host config

Modified:
    qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java

Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java?rev=1655138&r1=1655137&r2=1655138&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java Tue Jan 27 19:47:49 2015
@@ -20,14 +20,14 @@
  */
 package org.apache.qpid.common;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Map;
 import java.util.Properties;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * QpidProperties captures the project name, version number, and source code repository revision number from a properties
  * file which is generated as part of the build process. Normally, the name and version number are pulled from the module
@@ -76,10 +76,11 @@ public class QpidProperties
     /** Holds the source code revision. */
     private static String buildVersion = DEFAULT;
 
+    private static final Properties properties = new Properties();
+
     // Loads the values from the version properties file.
     static
     {
-        Properties props = new Properties();
 
         try
         {
@@ -90,12 +91,12 @@ public class QpidProperties
             }
             else
             {
-                props.load(propertyStream);
+                properties.load(propertyStream);
 
                 if (_logger.isDebugEnabled())
                 {
                     _logger.debug("Dumping QpidProperties");
-                    for (Map.Entry<Object, Object> entry : props.entrySet())
+                    for (Map.Entry<Object, Object> entry : properties.entrySet())
                     {
                         _logger.debug("Property: " + entry.getKey() + " Value: " + entry.getValue());
                     }
@@ -103,11 +104,11 @@ public class QpidProperties
                     _logger.debug("End of property dump");
                 }
 
-                productName = readPropertyValue(props, PRODUCT_NAME_PROPERTY);
-                String versionSuffix = (String) props.get(RELEASE_VERSION_SUFFIX);
-                String version = readPropertyValue(props, RELEASE_VERSION_PROPERTY);
+                productName = readPropertyValue(properties, PRODUCT_NAME_PROPERTY);
+                String versionSuffix = (String) properties.get(RELEASE_VERSION_SUFFIX);
+                String version = readPropertyValue(properties, RELEASE_VERSION_PROPERTY);
                 releaseVersion = versionSuffix == null || "".equals(versionSuffix) ? version : version + ";" + versionSuffix;
-                buildVersion = readPropertyValue(props, BUILD_VERSION_PROPERTY);
+                buildVersion = readPropertyValue(properties, BUILD_VERSION_PROPERTY);
             }
         }
         catch (IOException e)
@@ -117,6 +118,11 @@ public class QpidProperties
         }
     }
 
+    public static Properties asProperties()
+    {
+        return new Properties(properties);
+    }
+
     /**
      * Gets the product name.
      *



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org