该方法的位置:Glacier2ClientTest
加载配置文件:murong.properties 内容就是一行 requestUrl=https://mp.csdn.net/postedit/89882264
public class Glacier2ClientTest {
private static final String profile ="murong.properties";
static Properties properties = new Properties();
static {
try {
InputStream inputStream = Glacier2ClientTest.class.getClassLoader().getResourceAsStream(profile);
properties.load(inputStream);
inputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public static String getRequestUrl() {
return properties.getProperty("requestUrl");
}
@Test
public void testName() throws Exception {
String requsetUrl = Glacier2ClientTest.getRequestUrl();
System.out.println(requsetUrl);
}
}