public final class ReadFile{
private static Properties property;
static {
property = new Properties();
InputStream in = ReadFile.class.getClassLoader()
.getResourceAsStream(RESOURCE_PATH);//resource 下面的文件地址
try {
property.load(in);
} catch (IOException e) {
}
}
public static String getValue(String key) {
if (property == null) {
return null;
}
return property.getProperty(key);
}
}