方法1:
public class PathUtil {
private static ResourceBundle rb;public static synchronized String getPathInfo(String pathKey) {//参数:配置文件的key值
if (rb == null) {
rb = ResourceBundle.getBundle("path");//path为proterties文件的前缀名。
}
return rb.getString(pathKey);
}
}