org.nuiton.rss
Class RSSIOUtil

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

public class RSSIOUtil
extends 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, Map<Field,Object> values)
           
static com.sun.syndication.feed.synd.SyndFeed createFeed(EnumMap<Field,String> feedProperties, FeedType type, Map<Field,Object> values)
           
static com.sun.syndication.feed.synd.SyndEntry createFeedItem(EnumMap<Field,String> itemProperties, Map<Field,Object> values)
           
protected static EnumSet<Field> fillFeed(Map<Field,Object> values, EnumMap<Field,String> feedProperties, com.sun.syndication.feed.synd.SyndFeed feed, boolean treateModfied)
           
protected static Object getFieldValue(Object dst, String name)
           
static com.sun.syndication.feed.synd.SyndFeed readFeed(URL url)
          Load a feed from his url
static void saveFeed(File file, com.sun.syndication.feed.synd.SyndFeed feed)
          save a feed into a file.
static void saveFeed(Writer writer, com.sun.syndication.feed.synd.SyndFeed feed)
          save a feed into a writer.
protected static void setFieldValue(Object dst, String name, Object value)
           
static EnumSet<Field> updateFeed(com.sun.syndication.feed.synd.SyndFeed feed, EnumMap<Field,String> feedProperties, Map<Field,Object> values)
           
static EnumSet<Field> updateFeed(URL url, EnumMap<Field,String> feedProperties, Map<Field,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(URL url)
                                                       throws IllegalArgumentException,
                                                              com.sun.syndication.io.FeedException,
                                                              IOException
Load a feed from his url

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

saveFeed

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

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

saveFeed

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

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

createFeed

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

updateFeed

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

updateFeed

public static EnumSet<Field> updateFeed(com.sun.syndication.feed.synd.SyndFeed feed,
                                        EnumMap<Field,String> feedProperties,
                                        Map<Field,Object> values)
                                 throws ParseException,
                                        IllegalArgumentException,
                                        com.sun.syndication.io.FeedException,
                                        IOException
Throws:
ParseException
IllegalArgumentException
com.sun.syndication.io.FeedException
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,
                                                                      Map<Field,Object> values)
                                                               throws IOException,
                                                                      IllegalArgumentException,
                                                                      com.sun.syndication.io.FeedException,
                                                                      ParseException
Throws:
IOException
IllegalArgumentException
com.sun.syndication.io.FeedException
ParseException

createFeedItem

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

fillFeed

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

setFieldValue

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

getFieldValue

protected static Object getFieldValue(Object dst,
                                      String name)


Copyright © 2008-2011 CodeLutin. All Rights Reserved.