From 51914bf1ac4eb661ffe4c18f196d288741b483e3 Mon Sep 17 00:00:00 2001 From: veryben Date: Thu, 18 May 2017 17:40:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0IniFileReader=E4=BC=98?= =?UTF-8?q?=E5=85=88=E8=AF=BB=E5=8F=96=E6=96=87=E4=BB=B6=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/org/csource/common/IniFileReader.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/org/csource/common/IniFileReader.java b/src/org/csource/common/IniFileReader.java index 6be87e4..e872829 100644 --- a/src/org/csource/common/IniFileReader.java +++ b/src/org/csource/common/IniFileReader.java @@ -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();