清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
/** * 读取配置文件 * @param file * @return */ public static PropertiesConfiguration loadConfig(String file){ PropertiesConfiguration config = null; try { config = new PropertiesConfiguration(file); config.setEncoding("UTF-8"); config.setReloadingStrategy(new FileChangedReloadingStrategy()); config.setAutoSave(true); logger.info("加载配置文件成功..."); } catch (ConfigurationException e) { logger.info("加载配置文件失败,异常信息:"+e.getLocalizedMessage()); } return config; }
public static Configuration config = loadConfig("config.properties");
ConfigUtils.config.getString("weixin.app_id")