参数是html名,html位置为该文件同一包下
public static synchronized String getHtmlCode(String htmlName) throws Exception {
StringBuilder htmlCode = new StringBuilder();
try {
InputStream in = CreateHtmlUtil.class.getResourceAsStream(htmlName);
java.io.BufferedReader breader = new BufferedReader(new InputStreamReader(in, "utf-8"));
String currentLine;
while ((currentLine = breader.readLine()) != null) {
currentLine = currentLine.trim();
if(currentLine.equals(""))continue;
htmlCode.append(currentLine+"\r\n");
}
return htmlCode.toString();
} catch (Exception e) {
throw new Exception("HTML:"+e.getMessage());
}
}
追问CreateHtmlUtil
是什么?
追答该代码所在类名