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