fixed
authorJean-Philippe Orsini <jeanfi@gmail.com>
Fri, 1 Jul 2016 12:07:35 +0000 (14:07 +0200)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Fri, 1 Jul 2016 12:07:35 +0000 (14:07 +0200)
asciidoctorrss.props
src/main/java/Main.java

index 05273ad..55c8a0b 100644 (file)
@@ -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
index d012144..0dedab9 100644 (file)
@@ -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("<html>\n");
                
-               getHTMLHeader(props);
+               appendHTMLHeader(news, props);
                
                news.append("<body>\n");
                for (File adoc: adocs) {