package com.sinotrans.common.util;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
/**
* @auth mayanze
* @date 2019/1/9
*/
public class PropertiesUtil {
/**
* 获取配置文件属性
*
* @return
*/
public static Properties getProperties(){
Properties p = new Properties();
try {
InputStream in = ClassLoader.getSystemResourceAsStream("application.properties");
p.load(in);
String profiles = p.getProperty("profiles.active");
InputStream in1 = ClassLoader.getSystemResourceAsStream("application-"+profiles+".properties");
p.load(in1);
} catch (IOException e) {
e.printStackTrace();
}
return p;
}
}