Skip to content

Commit fa35490

Browse files
committed
InputStream use fix in ProcessUtil
- use PropertiesUtil to load Properties from file Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
1 parent dbaa818 commit fa35490

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎utils/src/com/cloud/utils/ProcessUtil.java‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package com.cloud.utils;
1818

1919
import java.io.File;
20-
import java.io.FileInputStream;
2120
import java.io.IOException;
2221
import java.util.Properties;
2322

@@ -44,10 +43,8 @@ public static void pidCheck(String pidDir, String run) throws ConfigurationExcep
4443
s_logger.debug("environment.properties could not be opened");
4544
}
4645
else {
47-
final FileInputStream finputstream = new FileInputStream(propsFile);
4846
final Properties props = new Properties();
49-
props.load(finputstream);
50-
finputstream.close();
47+
PropertiesUtil.loadFromFile(props, propsFile);
5148
dir = props.getProperty("paths.pid");
5249
if (dir == null) {
5350
dir = pidDir==null?"/var/run":pidDir;

0 commit comments

Comments
 (0)