org.nuiton.rss
Class RSSIOUtil

java.lang.Object
  extended by org.nuiton.rss.RSSIOUtil

public class RSSIOUtil
extends java.lang.Object

helper to read or save a feed

Author:
tony

Constructor Summary
protected RSSIOUtil()
           
 
Method Summary
protected static com.sun.syndication.feed.synd.SyndFeed addItemToFeed(com.sun.syndication.feed.synd.SyndFeed feed, com.sun.syndication.feed.synd.SyndEntry item, int nbEntries, java.util.Map<Field,java.lang.Object> values)
           
static com.sun.syndication.feed.synd.SyndFeed createFeed(java.util.EnumMap<Field,java.lang.String> feedProperties, FeedType type, java.util.Map<Field,java.lang.Object> values)
           
static com.sun.syndication.feed.synd.SyndEntry createFeedItem(java.util.EnumMap<Field,java.lang.String> itemProperties, java.util.Map<Field,java.lang.Object> values)
           
protected static java.util.EnumSet<Field> fillFeed(java.util.Map<Field,java.lang.Object> values, java.util.EnumMap<Field,java.lang.String> feedProperties, com.sun.syndication.feed.synd.SyndFeed feed, boolean treateModfied)
           
protected static java.lang.Object getFieldValue(java.lang.Object dst, java.lang.String name)
           
static com.sun.syndication.feed.synd.SyndFeed readFeed(java.net.URL url)
          Load a feed from his url
static void saveFeed(java.io.File file, com.sun.syndication.feed.synd.SyndFeed feed)
          save a feed into a file.
static void saveFeed(java.io.Writer writer, com.sun.syndication.feed.synd.SyndFeed feed)
          save a feed into a writer.
protected static void setFieldValue(java.lang.Object dst, java.lang.String name, java.lang.Object value)
           
static java.util.EnumSet<Field> updateFeed(com.sun.syndication.feed.synd.SyndFeed feed, java.util.EnumMap<Field,java.lang.String> feedProperties, java.util.Map<Field,java.lang.Object> values)
           
static java.util.EnumSet<Field> updateFeed(java.net.URL url, java.util.EnumMap<Field,java.lang.String> feedProperties, java.util.Map<Field,java.lang.Object> values)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RSSIOUtil

protected RSSIOUtil()
Method Detail

readFeed

public static com.sun.syndication.feed.synd.SyndFeed readFeed(java.net.URL url)
                                                       throws java.lang.IllegalArgumentException,
                                                              com.sun.syndication.io.FeedException,
                                                              java.io.IOException
Load a feed from his url

Parameters:
url - location of feed
Returns:
the java pojo feed
Throws:
java.lang.IllegalArgumentException
com.sun.syndication.io.FeedException
java.io.IOException

saveFeed

public static void saveFeed(java.io.File file,
                            com.sun.syndication.feed.synd.SyndFeed feed)
                     throws java.io.IOException,
                            com.sun.syndication.io.FeedException
save a feed into a file.

Parameters:
file -
feed -
Throws:
java.io.IOException
com.sun.syndication.io.FeedException

saveFeed

public static void saveFeed(java.io.Writer writer,
                            com.sun.syndication.feed.synd.SyndFeed feed)
                     throws java.io.IOException,
                            com.sun.syndication.io.FeedException
save a feed into a writer.

Parameters:
writer -
feed -
Throws:
java.io.IOException
com.sun.syndication.io.FeedException

createFeed

public static com.sun.syndication.feed.synd.SyndFeed createFeed(java.util.EnumMap<Field,java.lang.String> feedProperties,
                                                                FeedType type,
                                                                java.util.Map<Field,java.lang.Object> values)
                                                         throws java.text.ParseException
Throws:
java.text.ParseException

updateFeed

public static java.util.EnumSet<Field> updateFeed(java.net.URL url,
                                                  java.util.EnumMap<Field,java.lang.String> feedProperties,
                                                  java.util.Map<Field,java.lang.Object> values)
                                           throws java.text.ParseException,
                                                  java.lang.IllegalArgumentException,
                                                  com.sun.syndication.io.FeedException,
                                                  java.io.IOException
Throws:
java.text.ParseException
java.lang.IllegalArgumentException
com.sun.syndication.io.FeedException
java.io.IOException

updateFeed

public static java.util.EnumSet<Field> updateFeed(com.sun.syndication.feed.synd.SyndFeed feed,
                                                  java.util.EnumMap<Field,java.lang.String> feedProperties,
                                                  java.util.Map<Field,java.lang.Object> values)
                                           throws java.text.ParseException,
                                                  java.lang.IllegalArgumentException,
                                                  com.sun.syndication.io.FeedException,
                                                  java.io.IOException
Throws:
java.text.ParseException
java.lang.IllegalArgumentException
com.sun.syndication.io.FeedException
java.io.IOException

addItemToFeed

protected static com.sun.syndication.feed.synd.SyndFeed addItemToFeed(com.sun.syndication.feed.synd.SyndFeed feed,
                                                                      com.sun.syndication.feed.synd.SyndEntry item,
                                                                      int nbEntries,
                                                                      java.util.Map<Field,java.lang.Object> values)
                                                               throws java.io.IOException,
                                                                      java.lang.IllegalArgumentException,
                                                                      com.sun.syndication.io.FeedException,
                                                                      java.text.ParseException
Throws:
java.io.IOException
java.lang.IllegalArgumentException
com.sun.syndication.io.FeedException
java.text.ParseException

createFeedItem

public static com.sun.syndication.feed.synd.SyndEntry createFeedItem(java.util.EnumMap<Field,java.lang.String> itemProperties,
                                                                     java.util.Map<Field,java.lang.Object> values)
                                                              throws java.text.ParseException
Throws:
java.text.ParseException

fillFeed

protected static java.util.EnumSet<Field> fillFeed(java.util.Map<Field,java.lang.Object> values,
                                                   java.util.EnumMap<Field,java.lang.String> feedProperties,
                                                   com.sun.syndication.feed.synd.SyndFeed feed,
                                                   boolean treateModfied)
                                            throws java.text.ParseException
Throws:
java.text.ParseException

setFieldValue

protected static void setFieldValue(java.lang.Object dst,
                                    java.lang.String name,
                                    java.lang.Object value)

getFieldValue

protected static java.lang.Object getFieldValue(java.lang.Object dst,
                                                java.lang.String name)


Copyright © 2008-2009 CodeLutin. All Rights Reserved.