InputStream use fix in ProcessUtil

- use PropertiesUtil to load Properties from file

Signed-off-by: Laszlo Hornyak <[email protected]>


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 <[email protected]>
Authored: Fri Oct 25 21:49:16 2013 +0200
Committer: Laszlo Hornyak <[email protected]>
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;

Reply via email to