| 123456789101112131415161718192021222324252627282930 |
- package com.sagacloud.utils;
- import com.sagacloud.route.InitEnvRoute;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import java.io.IOException;
- import java.util.Properties;
- /**
- * Created by Xiaoyu on 2018/7/10
- */
- public class PropUtil {
- private static final Logger log = LoggerFactory.getLogger(PropUtil.class);
- static Properties prop = new Properties();
- static {
- try {
- prop.load(PropUtil.class.getClassLoader().getResourceAsStream("config.properties"));
- InitEnvRoute.dataPlatform = prop.getProperty("dataPlatform.baseUrl");
- } catch (IOException e) {
- e.printStackTrace();
- log.error("Load properties failed.");
- }
- }
- public static String getProperty(String key){
- return prop.getProperty(key);
- }
- }
|