@@ -0,0 +1,643 @@
+package main.java.util;%0A%0Aimport java.io.FileInputStream;%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.util.Properties;%0A%0Apublic class MyUtil %7B%0A%09/**%0A%09 * %E9%80%9A%E8%BF%87 %E6%8C%87%E5%AE%9A%E7%9A%84%E8%B7%AF%E5%BE%84 %E8%8E%B7%E5%8F%96 Properties %E5%AF%B9%E8%B1%A1%0A%09 * @param filePath %E5%B1%9E%E6%80%A7%E6%96%87%E4%BB%B6%E8%B7%AF%E5%BE%84%0A%09 * @return %E5%B1%9E%E6%80%A7%E5%AF%B9%E8%B1%A1%EF%BC%8C%E5%9C%A8%E8%AF%A5%E5%AF%B9%E8%B1%A1%E4%B8%8A%E5%8F%AF%E7%9B%B4%E6%8E%A5%E4%BD%BF%E7%94%A8getProperty%E8%8E%B7%E5%8F%96%E5%AF%B9%E5%BA%94%E7%9A%84%E5%B1%9E%E6%80%A7%E5%80%BC%E3%80%82%0A%09 * %09%09%09%3Cbr%3E%E5%BD%93%E5%8F%91%E7%94%9F%E5%BC%82%E5%B8%B8%E6%97%B6%E8%BF%94%E5%9B%9E null%0A%09 */%0A%09public static Properties getPropertyByPath(String filePath) %7B%0A%09%09Properties prop = new Properties();%0A%09%09%0A%09%09try %7B%0A%09%09%09InputStream inStream = new FileInputStream(filePath);%0A%09%09%09%0A%09%09%09prop.load(inStream);%0A%09%09%09%0A%09%09%09return prop;%0A%09%09%09%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09// TODO Auto-generated catch block%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%09%0A%09%09return null;%0A%09%7D%0A%7D%0A

添加 工具类，包含方法：通过路径获取Properties对象