紧急求救
我在项目启动时读取配置在windows下读取正常,部署到centos上就找不到配置文件?求大侠指点?下边是部分代码。
String configPath = UrlDeal.decodeURIComponent(c.getResource("").toString());
if (configPath.startsWith("file:/")){
// 获得操作系统
String osName = System.getProperties().getProperty("os.name");
if(osName.startsWith("Linux")){
configPath = configPath.substring(5).replace("%20", " ");
}else
configPath = configPath.substring(6).replace("%20", " ");
}
configPath += "khk/config/";
try {
ini.load(new FileInputStream(configPath+"config.system.properties"));
System.out.println(ini.getProperty("system.log.requestmask"));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}