Skip to content
Snippets Groups Projects
Commit 6e8e52d6 authored by tpylak's avatar tpylak
Browse files

when loading service.properties, allow to use ${variable} notation everywhere

SVN: 13770
parent 05ec97a3
No related merge requests found
...@@ -164,7 +164,7 @@ public class Parameters ...@@ -164,7 +164,7 @@ public class Parameters
{ {
try try
{ {
this.serviceProperties = ExtendedProperties.createWith(PropertyParametersUtil.loadServiceProperties()); this.serviceProperties = PropertyParametersUtil.loadServiceProperties();
PropertyUtils.trimProperties(serviceProperties); PropertyUtils.trimProperties(serviceProperties);
this.threads = createThreadParameters(serviceProperties); this.threads = createThreadParameters(serviceProperties);
this.mailProperties = createMailProperties(serviceProperties); this.mailProperties = createMailProperties(serviceProperties);
......
...@@ -45,9 +45,9 @@ import ch.systemsx.cisd.common.logging.LogCategory; ...@@ -45,9 +45,9 @@ import ch.systemsx.cisd.common.logging.LogCategory;
import ch.systemsx.cisd.common.logging.LogFactory; import ch.systemsx.cisd.common.logging.LogFactory;
import ch.systemsx.cisd.common.logging.LogInitializer; import ch.systemsx.cisd.common.logging.LogInitializer;
import ch.systemsx.cisd.common.utilities.ExtendedProperties; import ch.systemsx.cisd.common.utilities.ExtendedProperties;
import ch.systemsx.cisd.common.utilities.PropertyUtils;
import ch.systemsx.cisd.openbis.dss.generic.shared.IEncapsulatedOpenBISService; import ch.systemsx.cisd.openbis.dss.generic.shared.IEncapsulatedOpenBISService;
import ch.systemsx.cisd.openbis.dss.generic.shared.ServiceProvider; import ch.systemsx.cisd.openbis.dss.generic.shared.ServiceProvider;
import ch.systemsx.cisd.openbis.dss.generic.shared.utils.PropertyParametersUtil;
import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.IServer;
/** /**
...@@ -172,7 +172,7 @@ public class DataStoreServer ...@@ -172,7 +172,7 @@ public class DataStoreServer
return thisServer; return thisServer;
} }
private static SslSocketConnector createSocketConnector(ConfigParameters configParameters) private static SocketConnector createSocketConnector(ConfigParameters configParameters)
{ {
SslSocketConnector socketConnector = new SslSocketConnector(); SslSocketConnector socketConnector = new SslSocketConnector();
socketConnector.setKeystore(configParameters.getKeystorePath()); socketConnector.setKeystore(configParameters.getKeystorePath());
...@@ -205,7 +205,7 @@ public class DataStoreServer ...@@ -205,7 +205,7 @@ public class DataStoreServer
properties = new Properties(); properties = new Properties();
} else } else
{ {
properties = PropertyUtils.loadProperties(SERVICE_PROPERTIES_FILE); properties = PropertyParametersUtil.loadProperties(SERVICE_PROPERTIES_FILE);
} }
final Properties systemProperties = System.getProperties(); final Properties systemProperties = System.getProperties();
final Enumeration<?> propertyNames = systemProperties.propertyNames(); final Enumeration<?> propertyNames = systemProperties.propertyNames();
......
...@@ -118,7 +118,8 @@ public abstract class AbstractPluginTaskFactory<T> ...@@ -118,7 +118,8 @@ public abstract class AbstractPluginTaskFactory<T>
addAll(properties, pluginProperties); addAll(properties, pluginProperties);
if (StringUtils.isBlank(parametersFilePath) == false) if (StringUtils.isBlank(parametersFilePath) == false)
{ {
Properties propertiesFromFile = PropertyUtils.loadProperties(parametersFilePath); Properties propertiesFromFile =
PropertyParametersUtil.loadProperties(parametersFilePath);
addAll(properties, propertiesFromFile); addAll(properties, propertiesFromFile);
} }
return properties; return properties;
......
...@@ -44,9 +44,15 @@ public class PropertyParametersUtil ...@@ -44,9 +44,15 @@ public class PropertyParametersUtil
public static final String ITEMS_DELIMITER = ","; public static final String ITEMS_DELIMITER = ",";
/** loads server configuration */ /** loads server configuration */
public static Properties loadServiceProperties() public static ExtendedProperties loadServiceProperties()
{ {
return PropertyUtils.loadProperties(SERVICE_PROPERTIES_FILE); return loadProperties(SERVICE_PROPERTIES_FILE);
}
public static ExtendedProperties loadProperties(String filePath)
{
Properties properties = PropertyUtils.loadProperties(filePath);
return ExtendedProperties.createWith(properties);
} }
public static String getDataStoreCode(Properties serviceProperties) public static String getDataStoreCode(Properties serviceProperties)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment