增加IniFileReader优先读取文件系统配置文件功能

dev
veryben 2017-05-18 17:40:22 +08:00
parent ec1ed97ae5
commit 51914bf1ac
1 changed files with 9 additions and 2 deletions

View File

@ -129,9 +129,16 @@ public class IniFileReader
private void loadFromFile(String confFilePath) throws IOException {
InputStream in = null;
try {
// 优先从文件系统路径加载
if (new File(confFilePath).exists()) {
in = new FileInputStream(confFilePath);
//System.out.println("loadFrom...file path done");
}
// 从类路径加载
in = classLoader().getResourceAsStream(confFilePath);
//System.out.println("loadFrom...class path done");
else {
in = classLoader().getResourceAsStream(confFilePath);
//System.out.println("loadFrom...class path done");
}
readToParamTable(in);
} catch (Exception ex) {
ex.printStackTrace();