InputStream use fix in ProcessUtil

- use PropertiesUtil to load Properties from file

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
This commit is contained in:
Laszlo Hornyak 2013-10-25 21:49:16 +02:00
parent dbaa818d1e
commit fa35490fef

View File

@ -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;