public class RSSGenerator extends Object
| Modifier and Type | Field and Description |
|---|---|
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
|
| Modifier | Constructor and Description |
|---|---|
protected |
RSSGenerator() |
protected |
RSSGenerator(EnumMap<Field,String> feedProperties,
EnumMap<Field,String> itemProperties,
File generatorDirectory,
FeedType format,
int nbItems) |
protected |
RSSGenerator(File generatorDirectory) |
| Modifier and Type | Method and Description |
|---|---|
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) |
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
protected RSSGenerator()
protected RSSGenerator(EnumMap<Field,String> feedProperties, EnumMap<Field,String> itemProperties, File generatorDirectory, FeedType format, int nbItems)
protected RSSGenerator(File generatorDirectory)
public static RSSGenerator newDefaultInstance(File generatorDirectory) throws Exception
generatorDirectory - generator directoryException - pour tout pb lors de l'instanciation des objectspublic static RSSGenerator newDefaultInstance() throws Exception
Exception - pour tout pb lors de l'instanciation des objectspublic 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 feedParseException - if pb while parsing dateIOException - if io pbcom.sun.syndication.io.FeedException - if pb while creating feedpublic 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 writecom.sun.syndication.io.FeedException - if feed pbIOException - if io pbParseException - 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 - IOExceptioncom.sun.syndication.io.FeedExceptionParseExceptionpublic FeedType getFormat()
public int getNbItems()
protected File getFile(URL url) throws IllegalStateException
url - location of the fileIllegalStateException - if uri is not sytax validprotected FileLock acquireLock(File f) throws IOException
IOExceptionprotected void releaseLock(File f, FileLock lock) throws IOException
IOExceptionpublic File getGeneratorDirectory()
Copyright © 2008–2013 CodeLutin. All rights reserved.