/**
* 读取文件工具类
*/
public static void getFile(String path){
FileInputStream fis = null;
InputStreamReader isr = null;
BufferedReader br = null;
List<String> strRestults = new ArrayList<>();
try {
String strTemp;
fis = new FileInputStream(path);
isr = new InputStreamReader(fis,"GBK");
br = new BufferedReader(isr);
while((strTemp = br.readLine())!=null){
strRestults.add(strTemp);
}
for (int i = 0; i < strRestults.size(); i++) {
String strResult = strRestults.get(i);
logger.info(strResult);
}
}catch(FileNotFoundException e) {
logger.info("找不到指定文件");
}catch(IOException e) {
logger.info("读取文件失败");
}finally {
try {
br.close();
isr.close();
fis.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
}