配置文件-需放在资源文件目录下
import java.util.Locale;
import java.util.ResourceBundle;
public class ProxyConfig {
private static Locale locale=null;
private static ResourceBundle cache=null;
static {
try {
locale=Locale.getDefault();
cache=ResourceBundle.getBundle("proxy_authService",locale);
} catch (RuntimeException e){
e.printStackTrace();
}
}
/** 读取配置文件
* @param key
* @return
* */
public static String getKey(String key){
if(key!=null&&!key.equals("")){
return cache.getString(key);
}
return "";
}
}