Merge pull request #104 from swtseaman/dev

update:修复配置文件路径读取没带目录的问题
This commit is contained in:
Wendal Chen 2018-01-14 13:15:11 +08:00 committed by GitHub
commit cad79e97ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,10 +83,11 @@ public class PropertiesConfigureLoader extends AbstractConfigureLoader {
// 如果conf内含有nutz.boot.configure.properties.dir配置则读取该目录下的所有配置文件
// 配置示例 nutz.boot.configure.properties.dir=config, 那么读取的就是jar包当前目录下config子目录下的所有properties文件
if(conf.has("nutz.boot.configure.properties.dir")) {
String configDir = getPath(conf.get("nutz.boot.configure.properties.dir"));
for(String fileName: getFiles(configDir, "properties")) {
String configDir = conf.get("nutz.boot.configure.properties.dir");
String configPath = getPath(configDir);
for(String fileName: getFiles(configPath, "properties")) {
try {
File tmp = new File(getPath(fileName));
File tmp = new File(getPath(configDir, fileName));
if (tmp.exists() && tmp.canRead()) {
try (FileInputStream ins = new FileInputStream(tmp)) {
conf.load(Streams.utf8r(ins), false);