|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.nuiton.rss.RSSGenerator
public class RSSGenerator
generator of rss feeds to be stored in a file
| Field Summary | |
|---|---|
static DateFormat |
DATE_PARSER
date formater use to save date in feed and entries |
protected EnumMap<Field,String> |
feedProperties
dictonnary of field <-> property for feed |
protected FeedType |
format
feed format to use * |
protected File |
generatorDirectory
directory where feeds are stored |
protected EnumMap<Field,String> |
itemProperties
dictonnary of field <-> property for entry |
protected int |
nbItems
number of feed to use by default |
| Constructor Summary | |
|---|---|
protected |
RSSGenerator()
|
protected |
RSSGenerator(EnumMap<Field,String> feedProperties,
EnumMap<Field,String> itemProperties,
File generatorDirectory,
FeedType format,
int nbItems)
|
protected |
RSSGenerator(File generatorDirectory)
|
| Method Summary | |
|---|---|
protected FileLock |
acquireLock(File f)
|
void |
addItemToFeedFile(URL url,
int nbEntries,
Map<Field,Object> values)
Add a item to an existing feed file. |
void |
createFeedFile(URL url,
FeedType type,
Map<Field,Object> values)
|
void |
deleteFeedFile(URL toURL)
|
File |
getFeedFile(String name)
|
protected File |
getFile(URL url)
Obtain the file from his url location. |
FeedType |
getFormat()
|
File |
getGeneratorDirectory()
|
int |
getNbItems()
|
protected File |
getWriteFileLock(File f)
|
static RSSGenerator |
newDefaultInstance()
|
static RSSGenerator |
newDefaultInstance(File generatorDirectory)
|
protected void |
releaseLock(File f,
FileLock lock)
|
EnumSet<Field> |
updateFeedFile(URL url,
Map<Field,Object> values)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final DateFormat DATE_PARSER
protected final EnumMap<Field,String> feedProperties
protected final EnumMap<Field,String> itemProperties
protected final File generatorDirectory
protected final FeedType format
protected final int nbItems
| Constructor Detail |
|---|
protected RSSGenerator()
protected RSSGenerator(EnumMap<Field,String> feedProperties,
EnumMap<Field,String> itemProperties,
File generatorDirectory,
FeedType format,
int nbItems)
protected RSSGenerator(File generatorDirectory)
| Method Detail |
|---|
public static RSSGenerator newDefaultInstance(File generatorDirectory)
throws Exception
generatorDirectory - generator directory
Exception - pour tout pb lors de l'instanciation des objects
public static RSSGenerator newDefaultInstance()
throws Exception
Exception - pour tout pb lors de l'instanciation des objects
public void createFeedFile(URL url,
FeedType type,
Map<Field,Object> values)
throws IOException,
com.sun.syndication.io.FeedException,
ParseException
url - location where to create the filetype - fromat of feed to createvalues - properties of the feed
ParseException - if pb while parsing date
IOException - if io pb
com.sun.syndication.io.FeedException - if pb while creating feed
public void addItemToFeedFile(URL url,
int nbEntries,
Map<Field,Object> values)
throws IOException,
com.sun.syndication.io.FeedException,
ParseException
url - location of feed to usednbEntries - number of maximum entries to be written in feed filevalues - dictionnary of properties to write
com.sun.syndication.io.FeedException - if feed pb
IOException - if io pb
ParseException - if dateparser pbpublic void deleteFeedFile(URL toURL)
public EnumSet<Field> updateFeedFile(URL url,
Map<Field,Object> values)
throws IOException,
com.sun.syndication.io.FeedException,
ParseException
url - values -
IOException
com.sun.syndication.io.FeedException
ParseExceptionpublic FeedType getFormat()
public File getFeedFile(String name)
public int getNbItems()
protected File getFile(URL url)
throws IllegalStateException
url - location of the file
IllegalStateException - if uri is not sytax valid
protected FileLock acquireLock(File f)
throws IOException
IOExceptionprotected File getWriteFileLock(File f)
protected void releaseLock(File f,
FileLock lock)
throws IOException
IOExceptionpublic File getGeneratorDirectory()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||