日期:2014-05-17 浏览次数:20642 次
public static String loadFileContent(String file) {
InputStream is = FileUtil.class.getClassLoader().getResourceAsStream(file);
BufferedReader r = new BufferedReader(new InputStreamReader(is));
StringBuilder sbr = new StringBuilder();
String str = null;
try {
while ((str = r.readLine()) != null) {
sbr.append(str).append("\n");
}
is.close();
} catch (Exception e) {
return null;
}
return sbr.toString();
}