import java.io.IOException;
import java.util.Properties;
public class PropertyUtil {
private static Properties properties=null;
public static void init(){
properties=new Properties();
try {
properties.load(PropertyUtil.class.getClassLoader().getResourceAsStream("init.properties"));
} catch (IOException e) {
e.printStackTrace();
}
}
public static String getProperties(String key){
if(properties==null){
init();
}
return properties.getProperty(key);
}
}

被折叠的 条评论
为什么被折叠?



