Last active
October 9, 2016 19:27
-
-
Save alebaffa/f1f7e91dba6c6252d1237381da856645 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HtmlTextConverter | |
{ | |
private String fullFilenameWithPath; | |
public HtmlTextConverter(String fullFilenameWithPath) { this.fullFilenameWithPath = fullFilenameWithPath; } | |
public String convertToHtml() throws IOException { | |
BufferedReader reader = new BufferedReader(new FileReader(fullFilenameWithPath)); | |
String line = reader.readLine(); | |
String html = ""; | |
while (line != null) | |
{ | |
html += StringEscapeUtils.escapeHtml(line); | |
html += "<br />"; | |
line = reader.readLine(); | |
} | |
return html; | |
} | |
public String getFilename() { return this.fullFilenameWithPath; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment