springframework.core里提供了一个ClassPathResource类,传入文件名。
获取一个InputStream后可以构造一个BufferedReader来一行行读取。
package org.springframework.core.io;
InputStream is=new ClassPathResource("referer.txt").getInputStream();
springframework.core里提供了一个ClassPathResource类,传入文件名。
获取一个InputStream后可以构造一个BufferedReader来一行行读取。
package org.springframework.core.io;
InputStream is=new ClassPathResource("referer.txt").getInputStream();