/**
* 读取文本文件
* @param filepath
* @return
*/
public static StringBuilder parser(String filepath) {
InputStream inStream = StrUtils.class.getResourceAsStream(filepath);
String encoding = "UTF-8";
StringBuilder content = new StringBuilder();
if(inStream != null){
BufferedReader bufferedReader;
try {
InputStreamReader read = new InputStreamReader (inStream, encoding);
bufferedReader = new BufferedReader(read);
String c = bufferedReader.readLine();
while(c != null){
content.append(c);
c = bufferedReader.readLine();
}
bufferedReader.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
return content;
}