|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object yarfraw.io.FeedReader
public class FeedReader
Provides a set of function to facilitate reading of a RSS feed.
Field Summary | |
---|---|
protected File |
_file
|
protected FeedFormat |
_format
|
protected org.apache.commons.httpclient.methods.GetMethod |
_getMethod
|
protected org.apache.commons.httpclient.params.HttpClientParams |
_httpClientParams
|
protected org.apache.commons.httpclient.HttpURL |
_httpUrl
|
Constructor Summary | |
---|---|
FeedReader(File file)
Constructs a FeedReader to read from a local file. |
|
FeedReader(File file,
FeedFormat format)
Constructs a FeedReader to read from a local file. |
|
FeedReader(org.apache.commons.httpclient.methods.GetMethod getMethod)
Constructs a FeedReader to read from a remote source using Http. |
|
FeedReader(org.apache.commons.httpclient.HttpURL httpUrl)
Constructs a FeedReader to read from a remote source using Http. |
|
FeedReader(org.apache.commons.httpclient.HttpURL httpUrl,
org.apache.commons.httpclient.params.HttpClientParams params)
Constructs a FeedReader to read from a remote source using Http. |
|
FeedReader(String pathName)
Constructs a FeedReader to read from a local file. |
|
FeedReader(String pathName,
FeedFormat format)
Constructs a FeedReader to read from a local file. |
|
FeedReader(URI uri)
Constructs a FeedReader to read from a local file. |
|
FeedReader(URI uri,
FeedFormat format)
Constructs a FeedReader to read from a local file. |
Method Summary | |
---|---|
File |
getFile()
|
FeedFormat |
getFormat()
The FeedFormat this writer should be using.if this is not set, the default is RSS 2.0 format. |
org.apache.commons.httpclient.methods.GetMethod |
getGetMethod()
The GetMethod object to be used to remote from a remote source. |
org.apache.commons.httpclient.params.HttpClientParams |
getHttpClientParams()
|
protected InputStream |
getStream()
|
boolean |
isRemoteRead()
Is the reader reading the feed from a remote http link. |
ChannelFeed |
readChannel()
Reads a channel from a local or remote feed. |
static ChannelFeed |
readChannel(FeedFormat format,
InputStream inputStream)
Reads a channel from a local or remote feed with a custom ValidationEventHandler |
ChannelFeed |
readChannel(ValidationEventHandler validationEventHandler)
Reads a channel from a local or remote feed with a custom ValidationEventHandler |
void |
setFile(File file)
|
void |
setFormat(FeedFormat format)
The FeedFormat this writer should be using.if this is not set, the default is RSS 2.0 format. |
void |
setHttpClientParams(org.apache.commons.httpclient.params.HttpClientParams httpClientParams)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.commons.httpclient.HttpURL _httpUrl
protected org.apache.commons.httpclient.params.HttpClientParams _httpClientParams
protected org.apache.commons.httpclient.methods.GetMethod _getMethod
protected File _file
protected FeedFormat _format
Constructor Detail |
---|
public FeedReader(File file, FeedFormat format)
FeedReader
to read from a local file.
file
- - the local file to be read fromformat
- - the FeedFormat
of the feed.public FeedReader(String pathName, FeedFormat format)
FeedReader
to read from a local file.
pathName
- - full path of the fileformat
- - the FeedFormat
of the feed.public FeedReader(URI uri, FeedFormat format)
FeedReader
to read from a local file.
uri
- - the URI
that points to the fileformat
- - the FeedFormat
of the feed.public FeedReader(File file)
FeedReader
to read from a local file.
FeedFormat
will be set to default which is RSS 2.0
file
- - a local filepublic FeedReader(String pathName)
FeedReader
to read from a local file.
FeedFormat
will be set to default which is RSS 2.0
pathName
- - full path of the filepublic FeedReader(URI uri)
FeedReader
to read from a local file.
FeedFormat
will be set to default which is RSS 2.0
uri
- - the uril that points to the filepublic FeedReader(org.apache.commons.httpclient.HttpURL httpUrl, org.apache.commons.httpclient.params.HttpClientParams params) throws YarfrawException, IOException
FeedReader
to read from a remote source using Http.
httpUrl
- - the HttpURL
of the remote sourceparams
- - any HttpClientParams
YarfrawException
- - if parse failed
IOException
- - if format detection failedpublic FeedReader(org.apache.commons.httpclient.HttpURL httpUrl) throws YarfrawException, IOException
FeedReader
to read from a remote source using Http.
httpUrl
- - the HttpURL
of the remote source
YarfrawException
- - if parse failed
IOException
- - if format detection failedpublic FeedReader(org.apache.commons.httpclient.methods.GetMethod getMethod) throws YarfrawException, IOException
FeedReader
to read from a remote source using Http.
getMethod
-
YarfrawException
- - if parse failed
IOException
- - if format detection failedMethod Detail |
---|
public static ChannelFeed readChannel(FeedFormat format, InputStream inputStream) throws YarfrawException
ValidationEventHandler
format
- any supported FeedFormat
inputStream
- any InputStream
ChannelFeed
object
YarfrawException
- if read operation failed.public ChannelFeed readChannel(ValidationEventHandler validationEventHandler) throws YarfrawException
ValidationEventHandler
validationEventHandler
- a custom ValidationEventHandler
ChannelFeed
object
YarfrawException
- if read operation failed.public ChannelFeed readChannel() throws YarfrawException
ChannelFeed
object
YarfrawException
- if read operation failed.public org.apache.commons.httpclient.params.HttpClientParams getHttpClientParams()
public void setHttpClientParams(org.apache.commons.httpclient.params.HttpClientParams httpClientParams)
public org.apache.commons.httpclient.methods.GetMethod getGetMethod()
GetMethod
object to be used to remote from a remote source.
public boolean isRemoteRead()
protected InputStream getStream() throws IOException
IOException
public File getFile()
public void setFile(File file)
public FeedFormat getFormat()
FeedFormat
this writer should be using.null
format is ignored
rss 2.0 is recommended, use other format if you really need to
public void setFormat(FeedFormat format)
FeedFormat
this writer should be using.null
format is ignored
rss 2.0 is recommended, use other format if you really need to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |