fable.io
Class OPMLManager

java.lang.Object
  extended by fable.io.OPMLManager

public class OPMLManager
extends java.lang.Object

OPML Manager is a class that converts between OPML and a List of Feed(s)

Author:
Christopher Moh

Method Summary
static java.util.List<FableComponent> readOPML(java.lang.String fileName)
          Reads in an OPML file and returns a list of Feeds from that OPML file.
static boolean writeOPML(java.util.List<FableComponent> f, java.lang.String fileName)
          Writes a list of feeds to a file in OPML 1.0 format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readOPML

public static java.util.List<FableComponent> readOPML(java.lang.String fileName)
Reads in an OPML file and returns a list of Feeds from that OPML file. For major errors (non-xml, non-opml, body missing etc), an EMPTY (not null) feed is returned. For feeds that are not valid, the feed is not added.

If there are multiple opml entries or body within opml entries, all entries are read. Duplicate feeds are all included.

There is NO loading of feeds or their articles.

Every single Feed has a UID of RSSManager.GenericUID.

Parameters:
fileName - The file name
Returns:
The list of Feeds
Requires:
fileName != null

writeOPML

public static boolean writeOPML(java.util.List<FableComponent> f,
                                java.lang.String fileName)
Writes a list of feeds to a file in OPML 1.0 format. All components that are NOT feeds are ignored.

Parameters:
f - The list of feeds to the file
fileName - The file to write to
Returns:
true if the OPML is successfully exported, false otherwise
Requires:
f, fileName != null