读取配置文件

 

@Test
public void readRropertory() {
Properties properties = new Properties();
try {
       properties.load(this.getClass().getResourceAsStream("/conf/sample-setting.properties"));
       System.out.println(properties.get("envName"));
        } catch (IOException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
        }
}
 

 

你可能感兴趣的:(读取配置文件)