获取配置文件内容

public class ContextConfig {
	
	private static final Logger logger = LoggerFactory.getLogger(ContextConfig.class);
	
	private static ResourceBundle resource = null;
	
	private static boolean isDev = true;
	
	public static boolean getDev(){
		return isDev;
	}
	
	public static String getConfigValue(String value){
		if(null == resource){
			resource = PropertyResourceBundle.getBundle("文件名");
		}		
		if(null == value){
			logger.info("getConfigValue value is null");
			isDev = false;
			return null;
		}		
		return resource.getString(value);		
	}

}

 

posted @ 2016-12-27 16:51  神玄晓  阅读(231)  评论(0编辑  收藏  举报