首页>代码>SpringBoot开发非常美观的java博客系统(包含后台管理功能)>/mblog/mblog-base/src/main/java/mblog/base/context/Global.java
package mblog.base.context; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import mblog.base.lang.Consts; import mblog.base.utils.PropertiesLoader; /** * mblog 全局配置类 */ public class Global { /** * 保存全局属性值 */ private static ConcurrentMap<String, String> map = new ConcurrentHashMap<>(); /** * 属性文件加载对象 */ private static PropertiesLoader propertiesLoader = new PropertiesLoader(Consts.MTONS_CONFIG); private static Boolean imageDomain = null; private static String imageHost = null; /** * 获取配置 */ public static String getConfig(String key) { String value = map.get(key); if (value == null){ value = propertiesLoader.getProperty(key); map.put(key, value); } return value; } public static boolean getImageDomain() { if (imageDomain == null) { imageDomain = propertiesLoader.getBoolean("resource.domain", false); } return imageDomain; } public static String getImageHost() { if (imageHost == null) { imageHost = propertiesLoader.getProperty("resource.host"); } return imageHost; } }
最近下载更多
qiangmin1223 LV12
前天
Luck_ZDM LV11
4月12日
CaoCaii LV6
3月24日
lichengai LV7
2月26日
try8023 LV18
1月16日
空中飞尘 LV13
2023年12月13日
2410068425 LV23
2023年11月29日
lili535353 LV1
2023年11月29日
xiaokang1 LV10
2023年11月11日
Seaskye LV14
2023年11月4日