WANG 5 lat temu
rodzic
commit
0e7b032fe5

+ 4 - 31
src/main/java/cn/com/qmth/examcloud/commons/util/PropertiesUtil.java

@@ -41,22 +41,22 @@ public class PropertiesUtil {
 	}
 
 	/**
-	 * 初始化方法
+	 * 加载配置文件
 	 *
 	 * @author WANGWEI
 	 * @param resourceName
 	 */
 	public static void loadFromResource(String resourceName) {
-		load(PathUtil.getResoucePath(resourceName));
+		loadFromPath(PathUtil.getResoucePath(resourceName));
 	}
 
 	/**
-	 * 加载配置文件并观察配置文件
+	 * 加载配置文件
 	 *
 	 * @author WANGWEI
 	 * @param path
 	 */
-	public static synchronized void load(String path) {
+	public static synchronized void loadFromPath(String path) {
 		if (StringUtils.isBlank(path)) {
 			return;
 		}
@@ -75,33 +75,6 @@ public class PropertiesUtil {
 		}
 	}
 
-	/**
-	 * @param path
-	 * @param props
-	 */
-	public static void loadFromDir(String path, Properties props) {
-		File dir = new File(path + "");
-		if ((!dir.exists()) || (!dir.isDirectory())) {
-			LOG.error("directory [" + path + "] is illegal.");
-			return;
-		}
-
-		LOG.info("Loading all Properties files from path [" + path + "].");
-
-		File[] files = dir.listFiles();
-		if (null == files || 0 == files.length) {
-			return;
-		}
-		for (File file : files) {
-			if (file.isDirectory()) {
-				continue;
-			}
-			if (file.getName().toLowerCase().endsWith(".properties")) {
-				loadFromFile(file, props);
-			}
-		}
-	}
-
 	/**
 	 * @param resourceName
 	 * @param props