Skip to content

Instantly share code, notes, and snippets.

@alebaffa
Created October 10, 2016 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alebaffa/110a5655af39251a7992055394a999b4 to your computer and use it in GitHub Desktop.
Save alebaffa/110a5655af39251a7992055394a999b4 to your computer and use it in GitHub Desktop.
public String convertToHtml() throws IOException {
return convertToHtml(new FileReader(fullFilenameWithPath));
}
protected String convertToHtml(Reader reader) throws IOException {
BufferedReader bufferedReader = new BufferedReader(reader);
String line = bufferedReader.readLine();
String html = "";
while (line != null) {
html += StringEscapeUtils.escapeHtml(line);
html += "<br />";
line = bufferedReader.readLine();
}
return html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment