package com.fr.plugin.sso.utils; import com.fr.io.utils.ResourceIOUtils; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Properties; import java.util.ResourceBundle; public class PropertiesUtils { // private static final String RESOURCES_PATH = "config"; // private static ResourceBundle bundle = null; // // static { // bundle = ResourceBundle.getBundle(RESOURCES_PATH); // } // // public static String getProperties(String key){ // return bundle.getString(key); // } /** * 获取web-info下的配置文件 * @param path * @return */ public static Properties getProperties2(String path){ Properties p = new Properties(); try{ InputStream is = ResourceIOUtils.read("/resources/wz.properties"); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is)); p.load(bufferedReader); }catch(Exception e){ FRUtils.FRLogInfo("获取配置文件异常"); } return p; } }