org.stanwood.media.actions.podcast
Class RSSFeed

java.lang.Object
  extended by org.stanwood.media.actions.podcast.RSSFeed

public class RSSFeed
extends java.lang.Object

This class is used to create and update RSS feeds used to store the pod cast details


Constructor Summary
RSSFeed(java.io.File feedFile, java.lang.String baseUrl, MediaDirConfig dirConfig)
          The constructor used to create a instance of the RSSFeed object
 
Method Summary
 void addEntry(IFeedFile file)
          Used to add a pod cast entry to the RSS feed
 void createNewFeed()
          Used to create a new feed
 java.util.List<IFeedFile> getEntries()
          Used to get the entries form the feed.
 void parse()
          Used to parse the RSS feed
 void setArtwork(java.net.URL imageUrl)
          Used to set the feeds artwork
 void setDescription(java.lang.String description)
          Used to set the feeds description
 void setLink(java.net.URL link)
          Used to set the feeds link
 void setMaxEntries(long maxEntries, java.io.File rssDir)
          Used to set the maximum number of entries in the feed.
 void setTitle(java.lang.String title)
          Used to set the feeds title
 void write()
          Write the RSS feed to a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RSSFeed

public RSSFeed(java.io.File feedFile,
               java.lang.String baseUrl,
               MediaDirConfig dirConfig)
The constructor used to create a instance of the RSSFeed object

Parameters:
feedFile - The file used to store the pod cast RSS feed
baseUrl - The base URL of the feed
dirConfig - The media directory configuration
Method Detail

parse

public void parse()
           throws java.io.IOException,
                  com.sun.syndication.io.FeedException
Used to parse the RSS feed

Throws:
java.io.IOException - Thrown if their is a problem reading the RSS feed
com.sun.syndication.io.FeedException - Thrown if their is a problem parsing the RSS feed

createNewFeed

public void createNewFeed()
Used to create a new feed


setTitle

public void setTitle(java.lang.String title)
Used to set the feeds title

Parameters:
title - The title of the feed

setLink

public void setLink(java.net.URL link)
Used to set the feeds link

Parameters:
link - The link to the feed

setDescription

public void setDescription(java.lang.String description)
Used to set the feeds description

Parameters:
description - A plain text description of the feeds contents

setArtwork

public void setArtwork(java.net.URL imageUrl)
Used to set the feeds artwork

Parameters:
imageUrl - A URL to the feeds cover artwork

write

public void write()
           throws java.io.IOException,
                  com.sun.syndication.io.FeedException
Write the RSS feed to a file

Throws:
java.io.IOException - Thrown if their is a problem reading the RSS feed
com.sun.syndication.io.FeedException - Thrown if their is a problem parsing the RSS feed

getEntries

public java.util.List<IFeedFile> getEntries()
                                     throws ActionException
Used to get the entries form the feed.

Returns:
The entries
Throws:
ActionException - Thrown if their are any problems

addEntry

public void addEntry(IFeedFile file)
Used to add a pod cast entry to the RSS feed

Parameters:
file - The feed file to add to the RSS feed

setMaxEntries

public void setMaxEntries(long maxEntries,
                          java.io.File rssDir)
Used to set the maximum number of entries in the feed. If their are more entries in the feed than the max entries, then they are removed. Also the associated files are deleted.

Parameters:
maxEntries - Maximum number of entries
rssDir - The directory containing the RSS directory