From 427926f3bbd741b680a19d4c68b66ac0aa9ee8c9 Mon Sep 17 00:00:00 2001
From: tpylak <tpylak>
Date: Tue, 5 Jan 2010 12:52:41 +0000
Subject: [PATCH] minor refactoring

SVN: 14146
---
 .../openbis/dss/generic/server/DataStoreServer.java | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/DataStoreServer.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/DataStoreServer.java
index edc238045df..d410df32ec4 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/DataStoreServer.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/DataStoreServer.java
@@ -19,7 +19,6 @@ package ch.systemsx.cisd.openbis.dss.generic.server;
 import static ch.systemsx.cisd.openbis.generic.shared.GenericSharedConstants.DATA_STORE_SERVER_SERVICE_NAME;
 import static ch.systemsx.cisd.openbis.generic.shared.GenericSharedConstants.DATA_STORE_SERVER_WEB_APPLICATION_NAME;
 
-import java.io.File;
 import java.io.IOException;
 import java.util.Enumeration;
 import java.util.Properties;
@@ -101,8 +100,6 @@ public class DataStoreServer
 
     private static final int PREFIX_LENGTH = PREFIX.length();
 
-    private static final String SERVICE_PROPERTIES_FILE = "etc/service.properties";
-
     private static final Logger operationLog =
             LogFactory.getLogger(LogCategory.OPERATION, DataStoreServer.class);
 
@@ -199,13 +196,13 @@ public class DataStoreServer
 
     final static ConfigParameters getConfigParameters()
     {
-        final Properties properties;
-        if (new File(SERVICE_PROPERTIES_FILE).exists() == false)
+        Properties properties;
+        try
         {
-            properties = new Properties();
-        } else
+            properties = PropertyParametersUtil.loadServiceProperties();
+        } catch (ConfigurationFailureException ex)
         {
-            properties = PropertyParametersUtil.loadProperties(SERVICE_PROPERTIES_FILE);
+            properties = new Properties();
         }
         final Properties systemProperties = System.getProperties();
         final Enumeration<?> propertyNames = systemProperties.propertyNames();
-- 
GitLab