Created
October 9, 2016 21:06
-
-
Save alebaffa/f1e01dcfa82737091ff430fb40932d51 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 { | |
HtmlFormatter formatter = getHtmlFormatter(getReader()); | |
formatter.convertToHtml(); | |
return formatter.getHtml(); | |
} | |
private HtmlFormatter getHtmlFormatter(Reader reader) { | |
return new HtmlFormatter(reader); | |
} | |
protected Reader getReader() throws FileNotFoundException { | |
return new FileReader(fullFilenameWithPath); | |
} | |
public String getFilename() { | |
return this.fullFilenameWithPath; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment