浏览代码

jfinal 3.6

James 7 年之前
父节点
当前提交
38574f6164
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/main/java/com/jfinal/kit/Prop.java

+ 4 - 3
src/main/java/com/jfinal/kit/Prop.java

@@ -32,9 +32,10 @@ public class Prop {
 	protected Properties properties = null;
 	
 	/**
-	 * protected 构造方法便于子类扩展
+	 * 支持 new Prop().appendIfExists(...)
 	 */
-	protected Prop() {
+	public Prop() {
+		properties = new Properties();
 	}
 	
 	/**
@@ -156,7 +157,7 @@ public class Prop {
 	}
 	
 	public Prop appendIfExists(File file, String encoding) {
-		if (file.exists()) {
+		if (file.isFile()) {
 			append(new Prop(file, encoding));
 		}
 		return this;