public final class Configuration {
private static final String KEY_HTML_HEADER_FILE = "html.header.file";
+ private static final String KEY_HTML_FOOTER_FILE = "html.footer.file";
private static final String KEY_FEED_TITLE = "feed.title";
private static final String KEY_FEED_LINK = "feed.link";
private static final String KEY_FEED_DESCRIPTION = "feed.description";
return new File(str);
}
+
+ public File getHTMLFooterFile() {
+ String str;
+
+ str = properties.getProperty(KEY_HTML_FOOTER_FILE);
+
+ if (str == null)
+ return null;
+
+ return new File(str);
+ }
public static Configuration load(File f) throws IOException {
Properties props;
}
- public static void appendHTMLFooter(StringBuffer sb) {
- sb.append("</body>\n");
- sb.append("</html>");
+ private void appendHTMLFooter(StringBuffer sb) throws IOException {
+ sb.append(new String(Files.readAllBytes(config.getHTMLFooterFile().toPath()),
+ StandardCharsets.UTF_8));
+ appendEndTag(sb, "body", 1, true);
+ appendEndTag(sb, "html", 0, false);
}
public String toHTML(SyndEntry entry) throws IOException {
buf.append("</div>\n");
- HTML.appendHTMLFooter(buf);
+ appendHTMLFooter(buf);
return buf.toString();
}