net.sourceforge.rssowl.dao
Class Importer

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

public class Importer
extends Object

This class is used to import categories and favorites from external ressources (for example OPML documents).

Version:
1.1.3
Author:
Benjamin Pasero

Field Summary
private  String categoryTitle
           
private  org.jdom.Document document
           
private  String opmlFilePath
           
private  Category targetCategory
           
 
Constructor Summary
Importer(String opmlFilePath, Category targetCategory)
          Instantiate a new Importer
Importer(String opmlFilePath, String categoryTitle, Category targetCategory)
          Instantiate a new Importer
 
Method Summary
private  void importFromOPML(org.jdom.Element element, Category rssOwlCategory, boolean fromBlogroll)
          Recursivly import categorys / favorits from the OPML file
 void importNewsfeeds(boolean fromBlogroll)
          Import all newsfeeds from the OPML document into the target category.
private  boolean isCategory(org.jdom.Element element)
          Check if the given Element is to be interpreted as a Category.
private  void loadDocument(boolean forceDefaultEncoding)
          Load the OPML XML document from the given path / URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

categoryTitle

private String categoryTitle

document

private org.jdom.Document document

opmlFilePath

private String opmlFilePath

targetCategory

private Category targetCategory
Constructor Detail

Importer

public Importer(String opmlFilePath,
                Category targetCategory)
Instantiate a new Importer

Parameters:
opmlFilePath - The path or URL to the OPML file
targetCategory - The Category to import the newsfeeds into

Importer

public Importer(String opmlFilePath,
                String categoryTitle,
                Category targetCategory)
Instantiate a new Importer

Parameters:
opmlFilePath - The path or URL to the OPML file
categoryTitle - The Title of the root category of this import
targetCategory - The Category to import the newsfeeds into
Method Detail

importNewsfeeds

public void importNewsfeeds(boolean fromBlogroll)
                     throws FileNotFoundException,
                            org.jdom.JDOMException,
                            IOException
Import all newsfeeds from the OPML document into the target category.

Parameters:
fromBlogroll - If TRUE, the import is from a Blogroll
Throws:
FileNotFoundException - If an error occurs
org.jdom.JDOMException - If an error occurs
IOException - If an error occurs

importFromOPML

private void importFromOPML(org.jdom.Element element,
                            Category rssOwlCategory,
                            boolean fromBlogroll)
Recursivly import categorys / favorits from the OPML file

Parameters:
element - Current outline element
rssOwlCategory - Current rssOwlCategory
fromBlogroll - If TRUE, the import is from a Blogroll

isCategory

private boolean isCategory(org.jdom.Element element)
Check if the given Element is to be interpreted as a Category.

Parameters:
element - The Element from the XML Document to check.
Returns:
boolean TRUE if the Element is a Category.

loadDocument

private void loadDocument(boolean forceDefaultEncoding)
                   throws FileNotFoundException,
                          org.jdom.JDOMException,
                          IOException
Load the OPML XML document from the given path / URL.

Parameters:
forceDefaultEncoding - If TRUE, use OS default encoding and not UTF-8
Throws:
IOException - If an error occurs
org.jdom.JDOMException - If an error occurs
FileNotFoundException - If an error occurs


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo