You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ko...@apache.org on 2013/10/26 18:30:02 UTC
[1/6] git commit: updated refs/heads/master to c72f65d
Updated Branches:
refs/heads/master 790231528 -> c72f65dc1
InputStream use fix in PorpoertiesStorage
- Properties object polulation using PropertiesUtil.loadFromFile
- test added
- the separate FileNotFoundException handling block was removed as the next IOException block is catching it and it is only logging
Signed-off-by: Laszlo Hornyak <la...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5e1ea1a3
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5e1ea1a3
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5e1ea1a3
Branch: refs/heads/master
Commit: 5e1ea1a3e4411bf2c891406e189f9015c7327aec
Parents: 7902315
Author: Laszlo Hornyak <la...@gmail.com>
Authored: Thu Oct 24 21:20:56 2013 +0200
Committer: Laszlo Hornyak <la...@gmail.com>
Committed: Sat Oct 26 17:47:33 2013 +0200
----------------------------------------------------------------------
.../cloud/agent/dao/impl/PropertiesStorage.java | 14 ++----
.../agent/dao/impl/PropertiesStorageTest.java | 51 ++++++++++++++++++++
2 files changed, 54 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5e1ea1a3/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java b/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java
index 2bf26f4..411d946 100755
--- a/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java
+++ b/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java
@@ -17,7 +17,6 @@
package com.cloud.agent.dao.impl;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -26,6 +25,7 @@ import java.util.Properties;
import javax.ejb.Local;
+import org.apache.commons.io.IOUtils;
import org.apache.log4j.Logger;
import com.cloud.agent.dao.StorageComponent;
@@ -59,18 +59,10 @@ public class PropertiesStorage implements StorageComponent {
_properties.store(output, _name);
output.flush();
output.close();
- } catch (FileNotFoundException e) {
- s_logger.error("Who deleted the file? ", e);
} catch (IOException e) {
s_logger.error("Uh-oh: ", e);
} finally {
- if (output != null) {
- try {
- output.close();
- } catch (IOException e) {
- // ignore.
- }
- }
+ IOUtils.closeQuietly(output);
}
}
@@ -99,7 +91,7 @@ public class PropertiesStorage implements StorageComponent {
}
try {
- _properties.load(new FileInputStream(file));
+ PropertiesUtil.loadFromFile(_properties, file);
_file = file;
} catch (FileNotFoundException e) {
s_logger.error("How did we get here? ", e);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5e1ea1a3/agent/test/com/cloud/agent/dao/impl/PropertiesStorageTest.java
----------------------------------------------------------------------
diff --git a/agent/test/com/cloud/agent/dao/impl/PropertiesStorageTest.java b/agent/test/com/cloud/agent/dao/impl/PropertiesStorageTest.java
new file mode 100644
index 0000000..4075892
--- /dev/null
+++ b/agent/test/com/cloud/agent/dao/impl/PropertiesStorageTest.java
@@ -0,0 +1,51 @@
+package com.cloud.agent.dao.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+
+import junit.framework.Assert;
+
+import org.apache.commons.io.FileUtils;
+import org.junit.Test;
+
+public class PropertiesStorageTest {
+ @Test
+ public void configureWithNotExistingFile() {
+ String fileName = "target/notyetexistingfile"
+ + System.currentTimeMillis();
+ File file = new File(fileName);
+
+ PropertiesStorage storage = new PropertiesStorage();
+ HashMap<String, Object> params = new HashMap<String, Object>();
+ params.put("path", fileName);
+ Assert.assertTrue(storage.configure("test", params));
+ Assert.assertTrue(file.exists());
+ storage.persist("foo", "bar");
+ Assert.assertEquals("bar", storage.get("foo"));
+
+ storage.stop();
+ file.delete();
+ }
+
+ @Test
+ public void configureWithExistingFile() throws IOException {
+ String fileName = "target/existingfile"
+ + System.currentTimeMillis();
+ File file = new File(fileName);
+
+ FileUtils.writeStringToFile(file, "a=b\n\n");
+
+ PropertiesStorage storage = new PropertiesStorage();
+ HashMap<String, Object> params = new HashMap<String, Object>();
+ params.put("path", fileName);
+ Assert.assertTrue(storage.configure("test", params));
+ Assert.assertEquals("b", storage.get("a"));
+ Assert.assertTrue(file.exists());
+ storage.persist("foo", "bar");
+ Assert.assertEquals("bar", storage.get("foo"));
+
+ storage.stop();
+ file.delete();
+ }
+}
[4/6] git commit: updated refs/heads/master to c72f65d
Posted by ko...@apache.org.
InputStream use fix in PropertiesUtil
- use PropertiesUtil.loadFromFile to read the properties
- test added
Signed-off-by: Laszlo Hornyak <la...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/58477834
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/58477834
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/58477834
Branch: refs/heads/master
Commit: 58477834b6a4170022235a5ed0d495ee9c3ddd57
Parents: 5e1ea1a
Author: Laszlo Hornyak <la...@gmail.com>
Authored: Thu Oct 24 22:37:14 2013 +0200
Committer: Laszlo Hornyak <la...@gmail.com>
Committed: Sat Oct 26 17:47:34 2013 +0200
----------------------------------------------------------------------
utils/src/com/cloud/utils/PropertiesUtil.java | 2 +-
utils/test/com/cloud/utils/PropertiesUtilsTest.java | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/58477834/utils/src/com/cloud/utils/PropertiesUtil.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/PropertiesUtil.java b/utils/src/com/cloud/utils/PropertiesUtil.java
index 6db66ff..6f3796a 100755
--- a/utils/src/com/cloud/utils/PropertiesUtil.java
+++ b/utils/src/com/cloud/utils/PropertiesUtil.java
@@ -130,7 +130,7 @@ public class PropertiesUtil {
File commandsFile = findConfigFile(configFile);
if (commandsFile != null) {
try {
- preProcessedCommands.load(new FileInputStream(commandsFile));
+ loadFromFile(preProcessedCommands, commandsFile);
} catch (FileNotFoundException fnfex) {
// in case of a file within a jar in classpath, try to open stream using url
InputStream stream = PropertiesUtil.openStreamFromURL(configFile);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/58477834/utils/test/com/cloud/utils/PropertiesUtilsTest.java
----------------------------------------------------------------------
diff --git a/utils/test/com/cloud/utils/PropertiesUtilsTest.java b/utils/test/com/cloud/utils/PropertiesUtilsTest.java
index 5ebe095..d27a0b4 100644
--- a/utils/test/com/cloud/utils/PropertiesUtilsTest.java
+++ b/utils/test/com/cloud/utils/PropertiesUtilsTest.java
@@ -18,6 +18,7 @@ package com.cloud.utils;
import java.io.File;
import java.io.IOException;
+import java.util.Map;
import java.util.Properties;
import org.apache.commons.io.FileUtils;
@@ -30,6 +31,7 @@ public class PropertiesUtilsTest {
File configFile = PropertiesUtil.findConfigFile("notexistingresource");
Assert.assertNull(configFile);
}
+
@Test
public void loadFromFile() throws IOException {
File file = File.createTempFile("test", ".properties");
@@ -38,4 +40,15 @@ public class PropertiesUtilsTest {
PropertiesUtil.loadFromFile(properties, file);
Assert.assertEquals("b", properties.get("a"));
}
+
+ @Test
+ public void processConfigFile() throws IOException {
+ File tempFile = File.createTempFile("temp", ".properties");
+ FileUtils.writeStringToFile(tempFile, "a=b\nc=d\n");
+ Map<String, String> config = PropertiesUtil
+ .processConfigFile(new String[] { tempFile.getAbsolutePath() });
+ Assert.assertEquals("b", config.get("a"));
+ Assert.assertEquals("d", config.get("c"));
+ tempFile.delete();
+ }
}
[3/6] git commit: updated refs/heads/master to c72f65d
Posted by ko...@apache.org.
InputStream use fix
Closes the FileInputStream opened at configuration in
- ClusterManagerImpl
- ClusterServiceServletAdapter
- TransactionLegacy
- AsyncJobManagerImpl
- DBEncryptionUtil
- EncryptionSecretKeyChecker
Signed-off-by: Laszlo Hornyak <la...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/dbaa818d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/dbaa818d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/dbaa818d
Branch: refs/heads/master
Commit: dbaa818d1eaf80f7d62792abe380a8c7c2ffa0ac
Parents: c178315
Author: Laszlo Hornyak <la...@gmail.com>
Authored: Fri Oct 25 20:38:36 2013 +0200
Committer: Laszlo Hornyak <la...@gmail.com>
Committed: Sat Oct 26 17:47:34 2013 +0200
----------------------------------------------------------------------
framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java | 3 +--
.../src/com/cloud/cluster/ClusterServiceServletAdapter.java | 3 +--
framework/db/src/com/cloud/utils/db/TransactionLegacy.java | 1 +
.../cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java | 3 +--
utils/src/com/cloud/utils/crypt/DBEncryptionUtil.java | 2 +-
utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java | 3 +--
6 files changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbaa818d/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java
----------------------------------------------------------------------
diff --git a/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java b/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java
index 35968ee..71bea4f 100644
--- a/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java
+++ b/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java
@@ -17,7 +17,6 @@
package com.cloud.cluster;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.ConnectException;
@@ -1033,7 +1032,7 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
File dbPropsFile = PropertiesUtil.findConfigFile("db.properties");
Properties dbProps = new Properties();
try {
- dbProps.load(new FileInputStream(dbPropsFile));
+ PropertiesUtil.loadFromFile(dbProps, dbPropsFile);
} catch (FileNotFoundException e) {
throw new ConfigurationException("Unable to find db.properties");
} catch (IOException e) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbaa818d/framework/cluster/src/com/cloud/cluster/ClusterServiceServletAdapter.java
----------------------------------------------------------------------
diff --git a/framework/cluster/src/com/cloud/cluster/ClusterServiceServletAdapter.java b/framework/cluster/src/com/cloud/cluster/ClusterServiceServletAdapter.java
index 67df946..f80e21f 100644
--- a/framework/cluster/src/com/cloud/cluster/ClusterServiceServletAdapter.java
+++ b/framework/cluster/src/com/cloud/cluster/ClusterServiceServletAdapter.java
@@ -17,7 +17,6 @@
package com.cloud.cluster;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.rmi.RemoteException;
@@ -126,7 +125,7 @@ public class ClusterServiceServletAdapter extends AdapterBase implements Cluster
File dbPropsFile = PropertiesUtil.findConfigFile("db.properties");
Properties dbProps = new Properties();
try {
- dbProps.load(new FileInputStream(dbPropsFile));
+ PropertiesUtil.loadFromFile(dbProps, dbPropsFile);
} catch (FileNotFoundException e) {
throw new ConfigurationException("Unable to find db.properties");
} catch (IOException e) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbaa818d/framework/db/src/com/cloud/utils/db/TransactionLegacy.java
----------------------------------------------------------------------
diff --git a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java
index 9cf7c3f..a318d83 100755
--- a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java
+++ b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java
@@ -1039,6 +1039,7 @@ public class TransactionLegacy {
dbProps = new Properties();
}
try {
+ PropertiesUtil.loadFromFile(dbProps, dbPropsFile);
dbProps.load(new FileInputStream(dbPropsFile));
} catch (IOException e) {
s_logger.fatal("Unable to load db properties file, pl. check the classpath and file path configuration", e);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbaa818d/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
index ffc7b3a..29a299f 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
@@ -18,7 +18,6 @@
package org.apache.cloudstack.framework.jobs.impl;
import java.io.File;
-import java.io.FileInputStream;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
@@ -868,7 +867,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
try {
final File dbPropsFile = PropertiesUtil.findConfigFile("db.properties");
final Properties dbProps = new Properties();
- dbProps.load(new FileInputStream(dbPropsFile));
+ PropertiesUtil.loadFromFile(dbProps, dbPropsFile);
final int cloudMaxActive = Integer.parseInt(dbProps.getProperty("db.cloud.maxActive"));
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbaa818d/utils/src/com/cloud/utils/crypt/DBEncryptionUtil.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/crypt/DBEncryptionUtil.java b/utils/src/com/cloud/utils/crypt/DBEncryptionUtil.java
index 06df799..2f44c5a 100755
--- a/utils/src/com/cloud/utils/crypt/DBEncryptionUtil.java
+++ b/utils/src/com/cloud/utils/crypt/DBEncryptionUtil.java
@@ -78,7 +78,7 @@ public class DBEncryptionUtil {
StandardPBEStringEncryptor encryptor = EncryptionSecretKeyChecker.getEncryptor();
dbProps = new EncryptableProperties(encryptor);
try {
- dbProps.load(new FileInputStream(dbPropsFile));
+ PropertiesUtil.loadFromFile(dbProps, dbPropsFile);
} catch (FileNotFoundException e) {
throw new CloudRuntimeException("db.properties file not found while reading DB secret key", e);
} catch (IOException e) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbaa818d/utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java b/utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java
index bf6c351..56195de 100755
--- a/utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java
+++ b/utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java
@@ -18,7 +18,6 @@ package com.cloud.utils.crypt;
import java.io.BufferedReader;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
@@ -62,7 +61,7 @@ public class EncryptionSecretKeyChecker extends AdapterBase implements SystemInt
final File dbPropsFile = PropertiesUtil.findConfigFile("db.properties");
final Properties dbProps = new Properties();
try {
- dbProps.load(new FileInputStream(dbPropsFile));
+ PropertiesUtil.loadFromFile(dbProps, dbPropsFile);
final String encryptionType = dbProps.getProperty("db.cloud.encryption.type");
[6/6] git commit: updated refs/heads/master to c72f65d
Posted by ko...@apache.org.
Remove test dependency on mysql driver
The dependency is no longer needed.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c72f65dc
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c72f65dc
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c72f65dc
Branch: refs/heads/master
Commit: c72f65dc170f31c21a96c5af3dc3f59373b4596c
Parents: fa35490
Author: Laszlo Hornyak <la...@gmail.com>
Authored: Sat Oct 26 16:09:53 2013 +0200
Committer: Laszlo Hornyak <la...@gmail.com>
Committed: Sat Oct 26 17:47:35 2013 +0200
----------------------------------------------------------------------
server/pom.xml | 5 -----
1 file changed, 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c72f65dc/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index 8760fcb..c7978e2 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -135,11 +135,6 @@
<artifactId>cloud-engine-components-api</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
<resources>
[5/6] git commit: updated refs/heads/master to c72f65d
Posted by ko...@apache.org.
InputStream use fix in LibvirtComputingResource
- Properties object polulation using PropertiesUtil.loadFromFile
Signed-off-by: Laszlo Hornyak <la...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c1783153
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c1783153
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c1783153
Branch: refs/heads/master
Commit: c17831532e6fad4039b893a771376ef956e21550
Parents: 5847783
Author: Laszlo Hornyak <la...@gmail.com>
Authored: Thu Oct 24 22:45:43 2013 +0200
Committer: Laszlo Hornyak <la...@gmail.com>
Committed: Sat Oct 26 17:47:34 2013 +0200
----------------------------------------------------------------------
.../cloud/hypervisor/kvm/resource/LibvirtComputingResource.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c1783153/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 51ba743..49e3501 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -18,7 +18,6 @@ package com.cloud.hypervisor.kvm.resource;
import java.io.BufferedReader;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.BufferedOutputStream;
@@ -436,7 +435,7 @@ ServerResource {
s_logger.info("developer.properties found at " + file.getAbsolutePath());
Properties properties = new Properties();
try {
- properties.load(new FileInputStream(file));
+ PropertiesUtil.loadFromFile(properties, file);
String startMac = (String) properties.get("private.macaddr.start");
if (startMac == null) {
[2/6] git commit: updated refs/heads/master to c72f65d
Posted by ko...@apache.org.
InputStream use fix in ProcessUtil
- use PropertiesUtil to load Properties from file
Signed-off-by: Laszlo Hornyak <la...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fa35490f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fa35490f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fa35490f
Branch: refs/heads/master
Commit: fa35490fef785ae3963c428e7a3d3f9471382ebc
Parents: dbaa818
Author: Laszlo Hornyak <la...@gmail.com>
Authored: Fri Oct 25 21:49:16 2013 +0200
Committer: Laszlo Hornyak <la...@gmail.com>
Committed: Sat Oct 26 17:47:34 2013 +0200
----------------------------------------------------------------------
utils/src/com/cloud/utils/ProcessUtil.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fa35490f/utils/src/com/cloud/utils/ProcessUtil.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/ProcessUtil.java b/utils/src/com/cloud/utils/ProcessUtil.java
index e64c931..eee4ab5 100644
--- a/utils/src/com/cloud/utils/ProcessUtil.java
+++ b/utils/src/com/cloud/utils/ProcessUtil.java
@@ -17,7 +17,6 @@
package com.cloud.utils;
import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
@@ -44,10 +43,8 @@ public class ProcessUtil {
s_logger.debug("environment.properties could not be opened");
}
else {
- final FileInputStream finputstream = new FileInputStream(propsFile);
final Properties props = new Properties();
- props.load(finputstream);
- finputstream.close();
+ PropertiesUtil.loadFromFile(props, propsFile);
dir = props.getProperty("paths.pid");
if (dir == null) {
dir = pidDir==null?"/var/run":pidDir;