diff options
author | Robert Godfrey <rgodfrey@apache.org> | 2015-01-27 19:47:49 +0000 |
---|---|---|
committer | Robert Godfrey <rgodfrey@apache.org> | 2015-01-27 19:47:49 +0000 |
commit | be30b3ccba38b91f3842a80e83bd483665030aa2 (patch) | |
tree | db0ae8515c5d40770480a17e31b923fc4c08caed /qpid/java/common | |
parent | 971b6ce109b19231bb0514b45a343ced822dd404 (diff) | |
download | qpid-python-be30b3ccba38b91f3842a80e83bd483665030aa2.tar.gz |
QPID-6339 : Use variable interpolation for help url and initial virtual host config
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1655138 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/common')
-rw-r--r-- | qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java b/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java index cdd44d3443..74219f216e 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java @@ -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. * |