From d3a31aeee758dd09c87e463c6e22adf5713a01e5 Mon Sep 17 00:00:00 2001
From: brinn <brinn>
Date: Wed, 10 Oct 2012 18:57:24 +0000
Subject: [PATCH] Move IO related property helper methods from PropertyUtils to
 PropertyIOUtils.

SVN: 27144
---
 .../cisd/common/io/PropertyIOUtils.java       | 153 ++++++++++++++++++
 .../cisd/common/properties/PropertyUtils.java | 119 --------------
 .../cisd/common/io/PropertyIOUtilsTest.java   |  64 ++++++++
 .../common/properties/PropertyUtilsTest.java  |  34 +---
 .../systemsx/cisd/datamover/Parameters.java   |   3 +-
 .../etlserver/cifex/CifexExtractorHelper.java |   4 +-
 .../BackupDatabaseDescriptionGenerator.java   |   6 +-
 .../utils/DssPropertyParametersUtil.java      |   3 +-
 .../dsu/tracking/main/TrackingClient.java     |   4 +-
 .../WebClientConfigurationProvider.java       |   3 +-
 .../shared/coreplugin/CorePluginsUtils.java   |   4 +-
 ...DataSetInfoExtractorForProteinResults.java |   4 +-
 .../openbis/etlserver/proteomics/Util.java    |   4 +-
 13 files changed, 237 insertions(+), 168 deletions(-)
 create mode 100644 common/source/java/ch/systemsx/cisd/common/io/PropertyIOUtils.java
 create mode 100644 common/sourceTest/java/ch/systemsx/cisd/common/io/PropertyIOUtilsTest.java

diff --git a/common/source/java/ch/systemsx/cisd/common/io/PropertyIOUtils.java b/common/source/java/ch/systemsx/cisd/common/io/PropertyIOUtils.java
new file mode 100644
index 00000000000..f32ec777ba5
--- /dev/null
+++ b/common/source/java/ch/systemsx/cisd/common/io/PropertyIOUtils.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2012 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.common.io;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.Properties;
+
+import org.apache.commons.io.IOUtils;
+
+import ch.systemsx.cisd.common.exception.ConfigurationFailureException;
+import ch.systemsx.cisd.common.exception.UserFailureException;
+import ch.systemsx.cisd.common.filesystem.FileUtilities;
+import ch.systemsx.cisd.common.properties.PropertyUtils;
+
+/**
+ * A static helper class to help with loading and saving {@link Properties}.
+ *
+ * @author Bernd Rinn
+ */
+public class PropertyIOUtils
+{
+
+    /**
+     * Loads properties from the specified file and adds them to the specified properties.
+     * <ul>
+     * <li>Empty lines and lines starting with a hash symbol '#' are ignored.
+     * <li>All other lines should have a equals symbol '='. The trimmed part before/after '='
+     * specify property key and value , respectively.
+     * </ul>
+     */
+    public static void loadAndAppendProperties(Properties properties, File propertiesFile)
+    {
+        List<String> lines = FileUtilities.loadToStringList(propertiesFile);
+        for (int i = 0; i < lines.size(); i++)
+        {
+            String line = lines.get(i);
+            if (line.length() == 0 || line.startsWith("#"))
+            {
+                continue;
+            }
+            int indexOfEqualSymbol = line.indexOf('=');
+            if (indexOfEqualSymbol < 0)
+            {
+                throw new UserFailureException("Missing '=' in line " + (i + 1)
+                        + " of properties file '" + propertiesFile + "': " + line);
+            }
+            String key = line.substring(0, indexOfEqualSymbol).trim();
+            String value = line.substring(indexOfEqualSymbol + 1).trim();
+            properties.setProperty(key, value);
+        }
+    }
+
+    /**
+     * Loads properties from the specified file. This is a simpler version of
+     * {@link PropertyIOUtils#loadProperties(String)} which does not use {@link Properties#load(InputStream)}:
+     * <ul>
+     * <li>Empty lines and lines starting with a hash symbol '#' are ignored.
+     * <li>All other lines should have a equals symbol '='. The trimmed part before/after '='
+     * specify property key and value , respectively.
+     * </ul>
+     * There is no character escaping as in {@link Properties#load(InputStream)} because this can
+     * lead to problems if this syntax isn't known by the creator of a properties file.
+     */
+    public static Properties loadProperties(File propertiesFile)
+    {
+        Properties properties = new Properties();
+        loadAndAppendProperties(properties, propertiesFile);
+        return properties;
+    }
+
+    /**
+     * Loads and returns {@link Properties} found in given <var>propertiesFilePath</var>.
+     * 
+     * @throws ConfigurationFailureException If an exception occurs when loading the properties.
+     * @return never <code>null</code> but could return empty properties.
+     */
+    public final static Properties loadProperties(final InputStream is, final String resourceName)
+    {
+        assert is != null : "No input stream specified";
+        final Properties properties = new Properties();
+        try
+        {
+            properties.load(is);
+            PropertyUtils.trimProperties(properties);
+            return properties;
+        } catch (final Exception ex)
+        {
+            final String msg =
+                    String.format("Could not load the properties from given resource '%s'.",
+                            resourceName);
+            throw new ConfigurationFailureException(msg, ex);
+        } finally
+        {
+            IOUtils.closeQuietly(is);
+        }
+    }
+
+    /**
+     * Loads and returns {@link Properties} found in given <var>propertiesFilePath</var>.
+     * 
+     * @throws ConfigurationFailureException If an exception occurs when loading the properties.
+     * @return never <code>null</code> but could return empty properties.
+     */
+    public final static Properties loadProperties(final String propertiesFilePath)
+    {
+        try
+        {
+            return loadProperties(new FileInputStream(propertiesFilePath), propertiesFilePath);
+        } catch (FileNotFoundException ex)
+        {
+            final String msg = String.format("Properties file '%s' not found.", propertiesFilePath);
+            throw new ConfigurationFailureException(msg, ex);
+        }
+    }
+
+    /**
+     * Saves the given <var>properties</var> to the given <var>propertiesFile</var>.
+     */
+    public static void saveProperties(File propertiesFile, Properties properties)
+    {
+        final StringBuilder builder = new StringBuilder();
+        for (Entry<Object, Object> entry : properties.entrySet())
+        {
+            final String key = entry.getKey().toString();
+            final String value = entry.getValue().toString();
+            builder.append(key);
+            builder.append(" = ");
+            builder.append(value);
+            builder.append('\n');
+        }
+        FileUtilities.writeToFile(propertiesFile, builder.toString());
+    }
+
+}
diff --git a/common/source/java/ch/systemsx/cisd/common/properties/PropertyUtils.java b/common/source/java/ch/systemsx/cisd/common/properties/PropertyUtils.java
index bedb580e75c..0e493407ae6 100644
--- a/common/source/java/ch/systemsx/cisd/common/properties/PropertyUtils.java
+++ b/common/source/java/ch/systemsx/cisd/common/properties/PropertyUtils.java
@@ -16,25 +16,17 @@
 
 package ch.systemsx.cisd.common.properties;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.List;
 import java.util.Properties;
-import java.util.Map.Entry;
 
-import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.math.NumberUtils;
 
 import ch.systemsx.cisd.common.collection.CollectionUtils;
 import ch.systemsx.cisd.common.exception.ConfigurationFailureException;
-import ch.systemsx.cisd.common.exception.UserFailureException;
-import ch.systemsx.cisd.common.filesystem.FileUtilities;
 import ch.systemsx.cisd.common.logging.ISimpleLogger;
 import ch.systemsx.cisd.common.logging.LogLevel;
 
@@ -556,115 +548,4 @@ public final class PropertyUtils
         }
     }
 
-    /**
-     * Loads and returns {@link Properties} found in given <var>propertiesFilePath</var>.
-     * 
-     * @throws ConfigurationFailureException If an exception occurs when loading the properties.
-     * @return never <code>null</code> but could return empty properties.
-     */
-    public final static Properties loadProperties(final String propertiesFilePath)
-    {
-        try
-        {
-            return loadProperties(new FileInputStream(propertiesFilePath), propertiesFilePath);
-        } catch (FileNotFoundException ex)
-        {
-            final String msg = String.format("Properties file '%s' not found.", propertiesFilePath);
-            throw new ConfigurationFailureException(msg, ex);
-        }
-    }
-
-    /**
-     * Loads and returns {@link Properties} found in given <var>propertiesFilePath</var>.
-     * 
-     * @throws ConfigurationFailureException If an exception occurs when loading the properties.
-     * @return never <code>null</code> but could return empty properties.
-     */
-    public final static Properties loadProperties(final InputStream is, final String resourceName)
-    {
-        assert is != null : "No input stream specified";
-        final Properties properties = new Properties();
-        try
-        {
-            properties.load(is);
-            trimProperties(properties);
-            return properties;
-        } catch (final Exception ex)
-        {
-            final String msg =
-                    String.format("Could not load the properties from given resource '%s'.",
-                            resourceName);
-            throw new ConfigurationFailureException(msg, ex);
-        } finally
-        {
-            IOUtils.closeQuietly(is);
-        }
-    }
-
-    /**
-     * Loads properties from the specified file. This is a simpler version of
-     * {@link #loadProperties(String)} which does not use {@link Properties#load(InputStream)}:
-     * <ul>
-     * <li>Empty lines and lines starting with a hash symbol '#' are ignored.
-     * <li>All other lines should have a equals symbol '='. The trimmed part before/after '='
-     * specify property key and value , respectively.
-     * </ul>
-     * There is no character escaping as in {@link Properties#load(InputStream)} because this can
-     * lead to problems if this syntax isn't known by the creator of a properties file.
-     */
-    public static Properties loadProperties(File propertiesFile)
-    {
-        Properties properties = new Properties();
-        loadAndAppendProperties(properties, propertiesFile);
-        return properties;
-    }
-
-    /**
-     * Loads properties from the specified file and adds them to the specified properties.
-     * <ul>
-     * <li>Empty lines and lines starting with a hash symbol '#' are ignored.
-     * <li>All other lines should have a equals symbol '='. The trimmed part before/after '='
-     * specify property key and value , respectively.
-     * </ul>
-     */
-    public static void loadAndAppendProperties(Properties properties, File propertiesFile)
-    {
-        List<String> lines = FileUtilities.loadToStringList(propertiesFile);
-        for (int i = 0; i < lines.size(); i++)
-        {
-            String line = lines.get(i);
-            if (line.length() == 0 || line.startsWith("#"))
-            {
-                continue;
-            }
-            int indexOfEqualSymbol = line.indexOf('=');
-            if (indexOfEqualSymbol < 0)
-            {
-                throw new UserFailureException("Missing '=' in line " + (i + 1)
-                        + " of properties file '" + propertiesFile + "': " + line);
-            }
-            String key = line.substring(0, indexOfEqualSymbol).trim();
-            String value = line.substring(indexOfEqualSymbol + 1).trim();
-            properties.setProperty(key, value);
-        }
-    }
-
-    /**
-     * Saves the given <var>properties</var> to the given <var>propertiesFile</var>.
-     */
-    public static void saveProperties(File propertiesFile, Properties properties)
-    {
-        final StringBuilder builder = new StringBuilder();
-        for (Entry<Object, Object> entry : properties.entrySet())
-        {
-            final String key = entry.getKey().toString();
-            final String value = entry.getValue().toString();
-            builder.append(key);
-            builder.append(" = ");
-            builder.append(value);
-            builder.append('\n');
-        }
-        FileUtilities.writeToFile(propertiesFile, builder.toString());
-    }
-
 }
diff --git a/common/sourceTest/java/ch/systemsx/cisd/common/io/PropertyIOUtilsTest.java b/common/sourceTest/java/ch/systemsx/cisd/common/io/PropertyIOUtilsTest.java
new file mode 100644
index 00000000000..802499bdbc4
--- /dev/null
+++ b/common/sourceTest/java/ch/systemsx/cisd/common/io/PropertyIOUtilsTest.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2012 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.common.io;
+
+import java.io.File;
+import java.util.Properties;
+
+import org.testng.annotations.Test;
+
+import ch.systemsx.cisd.base.tests.AbstractFileSystemTestCase;
+import ch.systemsx.cisd.common.exception.UserFailureException;
+import ch.systemsx.cisd.common.filesystem.FileUtilities;
+
+/**
+ * Test cases for {@link PropertyIOUtils} class.
+ *
+ * @author Bernd Rinn
+ */
+public class PropertyIOUtilsTest extends AbstractFileSystemTestCase
+{
+
+    @Test
+    public void testLoadProperties()
+    {
+        File propertiesFile = new File(workingDirectory, "p.properties");
+        FileUtilities.writeToFile(propertiesFile, "answer = 42\n\n# comment\n  key=4711  ");
+        Properties properties = PropertyIOUtils.loadProperties(propertiesFile);
+
+        assertEquals("42", properties.getProperty("answer"));
+        assertEquals("4711", properties.getProperty("key"));
+    }
+
+    @Test
+    public void testLoadInvalidProperties()
+    {
+        File propertiesFile = new File(workingDirectory, "p.properties");
+        FileUtilities.writeToFile(propertiesFile, "answer=42\nquestion");
+
+        try
+        {
+            PropertyIOUtils.loadProperties(propertiesFile);
+            fail("UserFailureException expected");
+        } catch (UserFailureException ex)
+        {
+            assertEquals("Missing '=' in line 2 of properties file '" + propertiesFile
+                    + "': question", ex.getMessage());
+        }
+    }
+
+}
diff --git a/common/sourceTest/java/ch/systemsx/cisd/common/properties/PropertyUtilsTest.java b/common/sourceTest/java/ch/systemsx/cisd/common/properties/PropertyUtilsTest.java
index d3356bc7dd0..7d407291ab9 100644
--- a/common/sourceTest/java/ch/systemsx/cisd/common/properties/PropertyUtilsTest.java
+++ b/common/sourceTest/java/ch/systemsx/cisd/common/properties/PropertyUtilsTest.java
@@ -16,7 +16,6 @@
 
 package ch.systemsx.cisd.common.properties;
 
-import java.io.File;
 import java.util.Properties;
 
 import org.apache.commons.lang.math.NumberUtils;
@@ -26,15 +25,12 @@ import org.testng.annotations.Test;
 
 import ch.systemsx.cisd.base.tests.AbstractFileSystemTestCase;
 import ch.systemsx.cisd.common.exception.ConfigurationFailureException;
-import ch.systemsx.cisd.common.exception.UserFailureException;
-import ch.systemsx.cisd.common.filesystem.FileUtilities;
 import ch.systemsx.cisd.common.logging.BufferedAppender;
 import ch.systemsx.cisd.common.logging.ISimpleLogger;
 import ch.systemsx.cisd.common.logging.Log4jSimpleLogger;
-import ch.systemsx.cisd.common.properties.PropertyUtils;
 
 /**
- * Test cases for corresponding {@link PropertyUtils} class.
+ * Test cases for {@link PropertyUtils} class.
  * 
  * @author Christian Ribeaud
  */
@@ -50,34 +46,6 @@ public final class PropertyUtilsTest extends AbstractFileSystemTestCase
         appender.resetLogContent();
     }
 
-    @Test
-    public void testLoadProperties()
-    {
-        File propertiesFile = new File(workingDirectory, "p.properties");
-        FileUtilities.writeToFile(propertiesFile, "answer = 42\n\n# comment\n  key=4711  ");
-        Properties properties = PropertyUtils.loadProperties(propertiesFile);
-
-        assertEquals("42", properties.getProperty("answer"));
-        assertEquals("4711", properties.getProperty("key"));
-    }
-
-    @Test
-    public void testLoadInvalidProperties()
-    {
-        File propertiesFile = new File(workingDirectory, "p.properties");
-        FileUtilities.writeToFile(propertiesFile, "answer=42\nquestion");
-
-        try
-        {
-            PropertyUtils.loadProperties(propertiesFile);
-            fail("UserFailureException expected");
-        } catch (UserFailureException ex)
-        {
-            assertEquals("Missing '=' in line 2 of properties file '" + propertiesFile
-                    + "': question", ex.getMessage());
-        }
-    }
-
     @Test
     public final void testTrim()
     {
diff --git a/datamover/source/java/ch/systemsx/cisd/datamover/Parameters.java b/datamover/source/java/ch/systemsx/cisd/datamover/Parameters.java
index c64d0be81ed..bd29c4a675f 100644
--- a/datamover/source/java/ch/systemsx/cisd/datamover/Parameters.java
+++ b/datamover/source/java/ch/systemsx/cisd/datamover/Parameters.java
@@ -42,6 +42,7 @@ import ch.systemsx.cisd.base.utilities.OSUtilities;
 import ch.systemsx.cisd.common.exception.ConfigurationFailureException;
 import ch.systemsx.cisd.common.filesystem.HostAwareFile;
 import ch.systemsx.cisd.common.filesystem.highwatermark.HostAwareFileWithHighwaterMark;
+import ch.systemsx.cisd.common.io.PropertyIOUtils;
 import ch.systemsx.cisd.common.logging.LogCategory;
 import ch.systemsx.cisd.common.logging.LogFactory;
 import ch.systemsx.cisd.common.properties.ExtendedProperties;
@@ -463,7 +464,7 @@ public final class Parameters implements ITimingParameters, IFileSysParameters
     private final void initParametersFromProperties()
     {
         final Properties serviceProperties =
-                PropertyUtils.loadProperties(DatamoverConstants.SERVICE_PROPERTIES_FILE);
+                PropertyIOUtils.loadProperties(DatamoverConstants.SERVICE_PROPERTIES_FILE);
         dataCompletedScript =
                 tryCreateFile(serviceProperties, PropertyNames.DATA_COMPLETED_SCRIPT,
                         dataCompletedScript);
diff --git a/datastore_server/source/java/ch/systemsx/cisd/etlserver/cifex/CifexExtractorHelper.java b/datastore_server/source/java/ch/systemsx/cisd/etlserver/cifex/CifexExtractorHelper.java
index 17fab5258aa..deca8faf54c 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/etlserver/cifex/CifexExtractorHelper.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/etlserver/cifex/CifexExtractorHelper.java
@@ -20,7 +20,7 @@ import java.io.File;
 import java.util.Properties;
 
 import ch.systemsx.cisd.common.exception.UserFailureException;
-import ch.systemsx.cisd.common.properties.PropertyUtils;
+import ch.systemsx.cisd.common.io.PropertyIOUtils;
 import ch.systemsx.cisd.openbis.generic.shared.basic.DataSetUploadInfo;
 import ch.systemsx.cisd.openbis.generic.shared.basic.DataSetUploadInfo.DataSetUploadInfoHelper;
 
@@ -54,7 +54,7 @@ public class CifexExtractorHelper
         File propertiesFile = new File(incomingDataSetPath, fileName);
         if (propertiesFile.isFile())
         {
-            return PropertyUtils.loadProperties(propertiesFile.getPath());
+            return PropertyIOUtils.loadProperties(propertiesFile.getPath());
         } else
         {
             throw new UserFailureException("Request properties file '" + propertiesFile
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/dbbackup/BackupDatabaseDescriptionGenerator.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/dbbackup/BackupDatabaseDescriptionGenerator.java
index 84e37622f2b..a9241100758 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/dbbackup/BackupDatabaseDescriptionGenerator.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/dbbackup/BackupDatabaseDescriptionGenerator.java
@@ -25,8 +25,8 @@ import java.util.TreeSet;
 import org.apache.commons.lang.StringUtils;
 
 import ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked;
+import ch.systemsx.cisd.common.io.PropertyIOUtils;
 import ch.systemsx.cisd.common.properties.ExtendedProperties;
-import ch.systemsx.cisd.common.properties.PropertyUtils;
 import ch.systemsx.cisd.openbis.dss.generic.shared.utils.DssPluginType;
 import ch.systemsx.cisd.openbis.generic.shared.coreplugin.CorePluginScanner.ScannerType;
 import ch.systemsx.cisd.openbis.generic.shared.coreplugin.CorePluginsInjector;
@@ -92,7 +92,7 @@ public class BackupDatabaseDescriptionGenerator
     
     private Properties readPropertiesAndInjectCorePluginsIfDSS(File propertiesFile)
     {
-        Properties properties = PropertyUtils.loadProperties(propertiesFile);
+        Properties properties = PropertyIOUtils.loadProperties(propertiesFile);
         if (isDSSPropertiesFile(propertiesFile))
         {
             String corePluginsFolderRelativePath =
@@ -100,7 +100,7 @@ public class BackupDatabaseDescriptionGenerator
             File workingDirectory = propertiesFile.getParentFile().getParentFile();
             File corePluginsFolder = new File(workingDirectory, corePluginsFolderRelativePath);
             File file = new File(corePluginsFolder, CorePluginsUtils.CORE_PLUGINS_PROPERTIES_FILE);
-            PropertyUtils.loadAndAppendProperties(properties, file);
+            PropertyIOUtils.loadAndAppendProperties(properties, file);
             CorePluginsInjector injector =
                     new CorePluginsInjector(ScannerType.DSS, DssPluginType.values());
             injector.injectCorePlugins(properties, corePluginsFolder.getAbsolutePath());
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/utils/DssPropertyParametersUtil.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/utils/DssPropertyParametersUtil.java
index 96e1ed1edef..4a20a959a63 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/utils/DssPropertyParametersUtil.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/utils/DssPropertyParametersUtil.java
@@ -26,6 +26,7 @@ import ch.systemsx.cisd.common.exception.ConfigurationFailureException;
 import ch.systemsx.cisd.common.filesystem.FileOperations;
 import ch.systemsx.cisd.common.filesystem.FileUtilities;
 import ch.systemsx.cisd.common.filesystem.IFileOperations;
+import ch.systemsx.cisd.common.io.PropertyIOUtils;
 import ch.systemsx.cisd.common.properties.ExtendedProperties;
 import ch.systemsx.cisd.common.properties.PropertyUtils;
 import ch.systemsx.cisd.common.string.Template;
@@ -102,7 +103,7 @@ public class DssPropertyParametersUtil
 
     public static ExtendedProperties loadProperties(String filePath)
     {
-        return extendProperties(PropertyUtils.loadProperties(filePath));
+        return extendProperties(PropertyIOUtils.loadProperties(filePath));
     }
 
     private static ExtendedProperties extendProperties(Properties properties)
diff --git a/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/main/TrackingClient.java b/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/main/TrackingClient.java
index 2bd37f3b355..782600c502f 100644
--- a/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/main/TrackingClient.java
+++ b/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/main/TrackingClient.java
@@ -31,10 +31,10 @@ import ch.ethz.bsse.cisd.dsu.tracking.email.EntityTrackingEmailGenerator;
 import ch.ethz.bsse.cisd.dsu.tracking.email.IEntityTrackingEmailGenerator;
 import ch.ethz.bsse.cisd.dsu.tracking.utils.LogUtils;
 import ch.systemsx.cisd.common.exception.EnvironmentFailureException;
+import ch.systemsx.cisd.common.io.PropertyIOUtils;
 import ch.systemsx.cisd.common.logging.LogInitializer;
 import ch.systemsx.cisd.common.mail.EMailAddress;
 import ch.systemsx.cisd.common.mail.IMailClient;
-import ch.systemsx.cisd.common.properties.PropertyUtils;
 import ch.systemsx.cisd.common.shared.basic.string.StringUtils;
 import ch.systemsx.cisd.common.spring.HttpInvokerUtils;
 import ch.systemsx.cisd.openbis.generic.shared.ITrackingServer;
@@ -70,7 +70,7 @@ public class TrackingClient
     private static void track()
     {
         LogInitializer.init();
-        Properties props = PropertyUtils.loadProperties(SERVICE_PROPERTIES_FILE);
+        Properties props = PropertyIOUtils.loadProperties(SERVICE_PROPERTIES_FILE);
         Parameters params = new Parameters(props);
 
         ITrackingServer trackingServer = createOpenBISTrackingServer(params);
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/WebClientConfigurationProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/WebClientConfigurationProvider.java
index e417e6eac34..96bd16d7186 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/WebClientConfigurationProvider.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/WebClientConfigurationProvider.java
@@ -25,6 +25,7 @@ import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.Set;
 
+import ch.systemsx.cisd.common.io.PropertyIOUtils;
 import ch.systemsx.cisd.common.properties.PropertyParametersUtil;
 import ch.systemsx.cisd.common.properties.PropertyUtils;
 import ch.systemsx.cisd.common.properties.PropertyParametersUtil.SectionProperties;
@@ -102,7 +103,7 @@ public class WebClientConfigurationProvider
             initDefaultValues();
             return;
         }
-        Properties properties = PropertyUtils.loadProperties(configurationFile);
+        Properties properties = PropertyIOUtils.loadProperties(configurationFile);
         init(properties);
     }
 
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/CorePluginsUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/CorePluginsUtils.java
index 21abfed9f7e..58b68e577f6 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/CorePluginsUtils.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/CorePluginsUtils.java
@@ -19,7 +19,7 @@ package ch.systemsx.cisd.openbis.generic.shared.coreplugin;
 import java.io.File;
 import java.util.Properties;
 
-import ch.systemsx.cisd.common.properties.PropertyUtils;
+import ch.systemsx.cisd.common.io.PropertyIOUtils;
 import ch.systemsx.cisd.openbis.generic.shared.coreplugin.CorePluginScanner.ScannerType;
 
 /**
@@ -48,7 +48,7 @@ public class CorePluginsUtils
     {
         String corePluginsFolder = getCorePluginsFolder(properties, scannerType);
         File file = new File(corePluginsFolder, CORE_PLUGINS_PROPERTIES_FILE);
-        PropertyUtils.loadAndAppendProperties(properties, file);
+        PropertyIOUtils.loadAndAppendProperties(properties, file);
     }
 
     /**
diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/etlserver/proteomics/DataSetInfoExtractorForProteinResults.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/etlserver/proteomics/DataSetInfoExtractorForProteinResults.java
index 18c4d446400..218b70c7b77 100644
--- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/etlserver/proteomics/DataSetInfoExtractorForProteinResults.java
+++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/etlserver/proteomics/DataSetInfoExtractorForProteinResults.java
@@ -26,7 +26,7 @@ import org.apache.commons.lang.StringUtils;
 import ch.rinn.restrictions.Private;
 import ch.systemsx.cisd.common.exception.EnvironmentFailureException;
 import ch.systemsx.cisd.common.exception.UserFailureException;
-import ch.systemsx.cisd.common.properties.PropertyUtils;
+import ch.systemsx.cisd.common.io.PropertyIOUtils;
 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.dto.DataSetInformation;
@@ -193,7 +193,7 @@ public class DataSetInfoExtractorForProteinResults extends AbstractDataSetInfoEx
             properties = new Properties();
         } else
         {
-            properties = PropertyUtils.loadProperties(propertiesFile);
+            properties = PropertyIOUtils.loadProperties(propertiesFile);
         }
         return properties;
     }
diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/etlserver/proteomics/Util.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/etlserver/proteomics/Util.java
index ec3006d0f93..6c80df8cb8a 100644
--- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/etlserver/proteomics/Util.java
+++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/etlserver/proteomics/Util.java
@@ -22,7 +22,7 @@ import java.util.List;
 import java.util.Properties;
 
 import ch.systemsx.cisd.common.exception.UserFailureException;
-import ch.systemsx.cisd.common.properties.PropertyUtils;
+import ch.systemsx.cisd.common.io.PropertyIOUtils;
 import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityProperty;
 import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityType;
 import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityTypePropertyType;
@@ -104,6 +104,6 @@ class Util
             throw new UserFailureException("Properties file '" + propertiesFileName
                     + "' is a folder.");
         }
-        return PropertyUtils.loadProperties(propertiesFile);
+        return PropertyIOUtils.loadProperties(propertiesFile);
     }
 }
-- 
GitLab