From e50967c128e1b2514fdbce8f38ba2740698c72ff Mon Sep 17 00:00:00 2001 From: Jean-Philippe Orsini Date: Fri, 1 Jul 2016 14:07:35 +0200 Subject: [PATCH] fixed --- asciidoctorrss.props | 2 +- src/main/java/Main.java | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/asciidoctorrss.props b/asciidoctorrss.props index 05273ad..55c8a0b 100644 --- a/asciidoctorrss.props +++ b/asciidoctorrss.props @@ -3,4 +3,4 @@ feed.description=News of the wpitchoune.net website. feed.link=http://wpitchoune.net/news/feed.xml feed.baseurl=http://wpitchoune.net/news -html.header.file=header.html \ No newline at end of file +#html.header.file=header.html \ No newline at end of file diff --git a/src/main/java/Main.java b/src/main/java/Main.java index d012144..0dedab9 100644 --- a/src/main/java/Main.java +++ b/src/main/java/Main.java @@ -52,7 +52,8 @@ public class Main { return ret; } - private static String getHTMLHeader(Properties props) throws IOException { + private static void appendHTMLHeader(StringBuffer sb, Properties props) + throws IOException { String fileName; File f; @@ -60,12 +61,12 @@ public class Main { if (fileName == null) { LOG.info(KEY_HTML_HEADER_FILE + " is not set"); - return null; + return ; } f = new File(fileName); - return new String(Files.readAllBytes(f.toPath()), - StandardCharsets.UTF_8); + sb.append(new String(Files.readAllBytes(f.toPath()), + StandardCharsets.UTF_8)); } public static void main(String[] args) throws FileNotFoundException, IOException, FeedException { @@ -104,7 +105,7 @@ public class Main { news = new StringBuffer(); news.append("\n"); - getHTMLHeader(props); + appendHTMLHeader(news, props); news.append("\n"); for (File adoc: adocs) { -- 2.7.4