/* * [RSSBatchExport.java] * * Summary: Convert the rss/temprssbatch.bin binary log of items into HTML. * * Copyright: (c) 2009-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.8 2009-02-06 include go package in ZIP bundle. */ package com.mindprod.htmlmacros.support; import com.mindprod.common18.BigDate; import com.mindprod.common18.EIO; import com.mindprod.fastcat.FastCat; import com.mindprod.htmlmacros.support.RSSSortableItem.ByDescendingDate; import java.io.DataInputStream; import java.io.EOFException; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; /** * Convert the rss/temprssbatch.bin binary log of items into HTML. * * @author Roedy Green, Canadian Mind Products * @version 1.8 2009-02-06 include go package in ZIP bundle. * @see com.mindprod.htmlmacros.macro.RSSEnd# * @since 2009 */ public final class RSSBatchExport { private static final int NONE = BigDate.NULL_ORDINAL; /** * where the entire batch of RSS feeds is accumulated. */ private static FastCat sb; /** * emit html needed for end of a day */ private static void endDay() { sb.append( postlude() ); } /** * emit html to describe one item * * @param feedItem item whose previously computed HTML to expandNoRef. * @param fileBeingProcessed the file currently being processed. */ private static void expandBatchItem( RSSSortableItem feedItem, File fileBeingProcessed ) { sb.append( feedItem.asHTML( fileBeingProcessed ) ); } /** * get HTML to tack on end of group of feeds for a day. * * @return xml tail for an RSS feed file */ @SuppressWarnings( { "SameReturnValue" } ) private static String postlude() { return ""; } /** * get XML to tack on front of XML feed file. * * @param dateOrdinal BigDate ordinal of feeds in this day group * * @return html prelude to the group * * @return HTML to go on front of group of rss items for one day. */ private static String prelude( int dateOrdinal ) { return "" + new BigDate( dateOrdinal ).toString() + "