net.sourceforge.rssowl.dao
Class NewsfeedFactory

java.lang.Object
  extended bynet.sourceforge.rssowl.dao.NewsfeedFactory

public class NewsfeedFactory
extends Object

This class initializes the parser with a InputStream from the RSSUrl

Version:
1.1.3
Author:
Benjamin Pasero

Field Summary
private  org.jdom.Document document
          The builded document from the URL
private  FeedParser parser
          Parser for the document
private  Channel rssChannel
          Parsed Channel from the document
(package private)  String rssUrl
          The URL to the RSS / RDF / Atom feed
 
Constructor Summary
NewsfeedFactory(Favorite rssOwlFavorite)
          Create a new parser for the given URL to the RSS file
NewsfeedFactory(String rssUrl)
          Create a new parser for the given URL to the RSS file
NewsfeedFactory(String rssUrl, boolean ignoreRSS)
          Create a new parser for the given URL to the RSS file
 
Method Summary
 org.jdom.Document getDocument()
          Get the parsed document
 Channel getRSSChannel()
          Get the generated Channel
(package private)  void initXmlDocument(boolean forceDefaultEncoding)
          Init a new XML Parser from the RSS XML
private  void initXMLParser()
          Initialize the RSSOwlXMLParser with the given Document
private  org.jdom.Document openRSSFromLocal(org.jdom.input.SAXBuilder builder, boolean forceDefaultEncoding)
          Trys to open the RSS from the local path
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

document

private org.jdom.Document document
The builded document from the URL


parser

private FeedParser parser
Parser for the document


rssChannel

private Channel rssChannel
Parsed Channel from the document


rssUrl

String rssUrl
The URL to the RSS / RDF / Atom feed

Constructor Detail

NewsfeedFactory

public NewsfeedFactory(Favorite rssOwlFavorite)
                throws NewsfeedFactoryException
Create a new parser for the given URL to the RSS file

Parameters:
rssOwlFavorite - A favorite from the favoritesTree
Throws:
NewsfeedFactoryException - If an error occurs

NewsfeedFactory

public NewsfeedFactory(String rssUrl)
                throws NewsfeedFactoryException
Create a new parser for the given URL to the RSS file

Parameters:
rssUrl - URL or Path to the RSS XML
Throws:
NewsfeedFactoryException - If an error occurs

NewsfeedFactory

public NewsfeedFactory(String rssUrl,
                       boolean ignoreRSS)
                throws NewsfeedFactoryException
Create a new parser for the given URL to the RSS file

Parameters:
rssUrl - URL or Path to the RSS XML
ignoreRSS - ignoreRSS If TRUE its not intended to retrieve a RSS / RDF XML InputStream
Throws:
NewsfeedFactoryException - If an error occurs
Method Detail

getDocument

public org.jdom.Document getDocument()
Get the parsed document

Returns:
Document The parsed XML document

getRSSChannel

public Channel getRSSChannel()
Get the generated Channel

Returns:
Generated Channel from the RSS XML

initXMLParser

private void initXMLParser()
                    throws NewsfeedFactoryException
Initialize the RSSOwlXMLParser with the given Document

Throws:
NewsfeedFactoryException

openRSSFromLocal

private org.jdom.Document openRSSFromLocal(org.jdom.input.SAXBuilder builder,
                                           boolean forceDefaultEncoding)
                                    throws NewsfeedFactoryException
Trys to open the RSS from the local path

Parameters:
builder - The XML builder
forceDefaultEncoding - If set to TRUE the encoding is not being detected from the XMl document and the OS default encoding is used
Returns:
The parsed Document
Throws:
NewsfeedFactoryException - if an error occurs

initXmlDocument

void initXmlDocument(boolean forceDefaultEncoding)
               throws NewsfeedFactoryException
Init a new XML Parser from the RSS XML

Parameters:
forceDefaultEncoding - If set to TRUE the encoding is not being detected from the XMl document and the OS default encoding is used
Throws:
NewsfeedFactoryException


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo