增加IniFileReader优先读取文件系统配置文件功能
parent
ec1ed97ae5
commit
51914bf1ac
|
@ -129,9 +129,16 @@ public class IniFileReader
|
||||||
private void loadFromFile(String confFilePath) throws IOException {
|
private void loadFromFile(String confFilePath) throws IOException {
|
||||||
InputStream in = null;
|
InputStream in = null;
|
||||||
try {
|
try {
|
||||||
|
// 优先从文件系统路径加载
|
||||||
|
if (new File(confFilePath).exists()) {
|
||||||
|
in = new FileInputStream(confFilePath);
|
||||||
|
//System.out.println("loadFrom...file path done");
|
||||||
|
}
|
||||||
// 从类路径加载
|
// 从类路径加载
|
||||||
in = classLoader().getResourceAsStream(confFilePath);
|
else {
|
||||||
//System.out.println("loadFrom...class path done");
|
in = classLoader().getResourceAsStream(confFilePath);
|
||||||
|
//System.out.println("loadFrom...class path done");
|
||||||
|
}
|
||||||
readToParamTable(in);
|
readToParamTable(in);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
|
|
Loading…
Reference in New Issue