fixed
[asciidoctor_to_rss.git] / src / main / java / Main.java
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) {