Skip to content

Instantly share code, notes, and snippets.

@alebaffa
Created October 9, 2016 21:06
Show Gist options
  • Save alebaffa/f1e01dcfa82737091ff430fb40932d51 to your computer and use it in GitHub Desktop.
Save alebaffa/f1e01dcfa82737091ff430fb40932d51 to your computer and use it in GitHub Desktop.
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