org.clapper.curn
Class Curn

java.lang.Object
  extended by org.clapper.curn.Curn

public class Curn
extends java.lang.Object

curn: Customizable Utilitarian RSS Notifier.

curn is an RSS reader. It scans a configured set of URLs, each one representing an RSS feed, and summarizes the results in an easy-to-read text format. curn keeps track of URLs it's seen before, using an on-disk cache; when using the cache, it will suppress displaying URLs it has already reported (though that behavior can be disabled). curn can be extended to use any RSS parser; by default, it uses the ROME parser.

The Curn class represents the API entry point into the curn processing. Any program can call a Curn object's processRSSFeeds() method to invoke a curn run. In practice, most people use the existing Tool command-line program.

Version:
$Revision$

Constructor Summary
Curn()
          Deprecated. Use Curn(PrintWriter)
Curn(java.io.PrintWriter err)
          Instantiate a new Curn object and loads its plug-ins.
 
Method Summary
 void run(java.net.URL configURL, boolean useCache)
          Run curn against a configuration file.
 void setAbortOnUndefinedConfigVariable(boolean enable)
          Set or clear the flag that controls whether the curn configuration parser will abort when it encounters an undefined configuration variable.
 void setCurrentTime(java.util.Date newTime)
          Set the cache's notion of the current time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Curn

public Curn()
     throws CurnException
Deprecated. Use Curn(PrintWriter)

Instantiate a new Curn object and load its plug-ins.

Throws:
CurnException - on error

Curn

public Curn(java.io.PrintWriter err)
     throws CurnException
Instantiate a new Curn object and loads its plug-ins.

Parameters:
err - Where to write error messages the user should see
Throws:
CurnException - on error
Method Detail

run

public void run(java.net.URL configURL,
                boolean useCache)
         throws CurnException
Run curn against a configuration file.

Parameters:
configURL - URL to the configuration data
useCache - whether or not to use the cache
Throws:
CurnException - some other error

setCurrentTime

public void setCurrentTime(java.util.Date newTime)
Set the cache's notion of the current time. This method will change the time used when reading and pruning the cache from the current time to the specified time. This method must be called before processRSSFeeds().

Parameters:
newTime - the time to pretend is the current time

setAbortOnUndefinedConfigVariable

public void setAbortOnUndefinedConfigVariable(boolean enable)
Set or clear the flag that controls whether the curn configuration parser will abort when it encounters an undefined configuration variable. If thisd flag is clear, then an undefined variable is expanded to an empty string. If this flag is set, then an undefined value causes curn to abort. The flag defaults to true.

Parameters:
enable - true to enable the "abort on undefined variable" flag, false to disable it.


Copyright © 2004-2007 Brian M. Clapper. All Rights Reserved.