Properties是Java中jdk自带的一个对象
一般使用这个对象加载配置文件
InputStream in = JedisPoolUtils.class.getClassLoader().getResourceAsStream("redis.properties");
Properties pro = new Properties();
try {
pro.load(in);//把in传入这个对象
} catch (IOException e) {
e.printStackTrace();
}
读取的时候
这是一个Properties里面的内容
redis.maxIdle=30
redis.minIdle=10
redis.maxTotal=100
redis.url=192.168.186.131
redis.port=6379
读取就直接pro.get(“redis.maxIdle”)就读取出来了