- propFileName = propDir + "/appc-config-adaptor.properties";
- log.warn("Environment variable " + CCA_PROP_FILE_VAR + " unset - defaulting to " + propFileName);
- }
+ // Read properties from appc-config-adaptor.properties
+ String propFileName = CcAdaptorConstants.getEnvironmentVariable(CcAdaptorConstants.CCA_PROP_FILE_VAR);
+ if (propFileName == null)
+ {
+ String propDir = CcAdaptorConstants.getEnvironmentVariable(CcAdaptorConstants.APPC_CONFIG_DIR_VAR);
+ if (propDir == null)
+ throw new ConfigurationException(
+ "Cannot find config file - " + CcAdaptorConstants.CCA_PROP_FILE_VAR + " and " +
+ CcAdaptorConstants.APPC_CONFIG_DIR_VAR + " unset");
+
+ propFileName = propDir + "/appc-config-adaptor.properties";
+ log.warn("Environment variable " + CcAdaptorConstants.CCA_PROP_FILE_VAR + " unset - defaulting to "
+ + propFileName);
+ }