import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class PropertiesUtil {
/**
* 根据配置文件名称,返回Properties对象
* properties.getProperty("ip").trim()
* @return Properties
* @throws IOException
*/
public static Properties readProperties(String propertiesName) throws IOException{
//读取properties配置文件
Properties properties = new Properties();
InputStream is = PropertiesUtil.class.getClassLoader().getResourceAsStream(propertiesName);//new BufferedInputStream(new FileInputStream("./conf/pue_conf.properties"));
properties.load(is);
return properties;
}
}