public class RssReader extends java.lang.Object implements FormatReader<RssItem>
| Constructor and Description |
|---|
RssReader()
Create a new RssReader.
|
RssReader(java.lang.String urlStr)
Create a new RssReader from the given URL, specified by a string
|
RssReader(java.net.URL url)
Create a new RssReader from the given URL
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead()
Return whether this reader is in a state where it can attempt to read
data.
|
void |
close()
Close this reader.
|
java.lang.String |
getFilters()
Get the filters for this reader.
|
java.lang.String |
getSource()
Get the source for this reader
|
boolean |
hasMoreData()
Returns whether the reader has more data to read.
|
java.util.List<RssItem> |
readData()
Read data from the RssReader.
|
void |
setDelay(long seconds)
Set the time the RSS feed must wait before checking the website for new
data.
|
void |
setFilters(java.lang.String filters)
Set the filters for this reader.
|
void |
setSource(java.lang.String source)
Set the source for this Rss Reader.
|
public RssReader()
setSource() methodpublic RssReader(java.lang.String urlStr)
throws java.io.IOException,
org.xml.sax.SAXException
urlStr - the RSS feed URL stringjava.io.IOException - if there is a problem opening a connection to the
streamorg.xml.sax.SAXException - if there is a problem reading the data from the
streampublic RssReader(java.net.URL url)
throws java.io.IOException,
org.xml.sax.SAXException
url - the RSS feed URLjava.io.IOException - if there is a problem opening a connection to the
streamorg.xml.sax.SAXException - if there is a problem reading the data from the
streampublic boolean canRead()
canRead in interface FormatReader<RssItem>public void close()
close in interface FormatReader<RssItem>public java.lang.String getFilters()
getFilters in interface FormatReader<RssItem>public java.lang.String getSource()
getSource in interface FormatReader<RssItem>public boolean hasMoreData()
hasMoreData in interface FormatReader<RssItem>public java.util.List<RssItem> readData()
readData in interface FormatReader<RssItem>public void setDelay(long seconds)
seconds - the number of seconds to delay.public void setFilters(java.lang.String filters)
setFilters in interface FormatReader<RssItem>filters - public void setSource(java.lang.String source)
setSource in interface FormatReader<RssItem>source - the source URL for the RSS feed.