|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.clearfield.rss.SimpleRSSGenerator
public class SimpleRSSGenerator
Copyright © 2006 Clearfield Software Ltd. This software is distributed under the BSD license. See the accompanying license.txt for details.
Standalone class to generate the XML file needed to drive an RSS feed.
This class implements the simplest RSS scenario, generating an XML file conformant to the RSS 2.0 standard, containing a single channel.
This class was generated with the help of the Document
Making An RSS Feed by Danny Sullivan of Search Engine Watch. Incidentally, the document states that new RSS items should be
placed at the top of the XML, but research shows that modern RSS aggregators don't require this, so this implementation places new RSS
items at the bottom of the XML.
| Field Summary | |
|---|---|
static int |
DEFAULT_MAXIMUM_ITEM_COUNT
|
| Constructor Summary | |
|---|---|
SimpleRSSGenerator(java.io.File rssFile,
java.lang.String channelTitle,
java.lang.String channelDescription,
java.net.URL channelLink)
Creates an new RSS generator. |
|
| Method Summary | |
|---|---|
void |
add(java.lang.String itemTitle,
java.lang.String itemDescription,
java.lang.String itemLink)
Adds an RSS item into the feed. |
int |
getMaximumItemCount()
Gets the maximum number of items allowed to exist in this XML file at one time. |
void |
publish()
Commits the generated RSS feed to disk. |
void |
setMaximumItemCount(int maximumItemCount)
Gets the maximum number of items allowed to exist in this XML file at one time. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_MAXIMUM_ITEM_COUNT
| Constructor Detail |
|---|
public SimpleRSSGenerator(java.io.File rssFile,
java.lang.String channelTitle,
java.lang.String channelDescription,
java.net.URL channelLink)
throws java.io.IOException,
org.jdom.JDOMException
rssFile - File into which the RSS feed is output. Will be created if it does not existchannelTitle - Brief title for the RSS feedchannelDescription - Description of the RSS feedchannelLink - URL of the website hosting the RSS feed
java.io.IOException - In the case of an I/O problem when attempting to load the given RSS file
org.jdom.JDOMException - If JDOM cannot parse the XML in the given RSS file| Method Detail |
|---|
public void add(java.lang.String itemTitle,
java.lang.String itemDescription,
java.lang.String itemLink)
itemTitle - Brief title of the itemitemDescription - Short description of the item, to be displayed as body content in some aggregatorsitemLink - URL pointing to the website-based content, fetched and displayed as body content in some aggregators, as a link in others.
java.lang.IllegalArgumentException - Thrown should the underlying XML not contain the expected structure
public void publish()
throws java.io.IOException
java.io.IOException - Should an I/O exception occur when writing to diskpublic int getMaximumItemCount()
public void setMaximumItemCount(int maximumItemCount)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||