| java.lang.Object org.clapper.curn.output.FileOutputHandler
All known Subclasses: org.clapper.curn.output.script.ScriptOutputHandler, org.clapper.curn.output.freemarker.FreeMarkerOutputHandler,
FileOutputHandler | abstract public class FileOutputHandler implements OutputHandler(Code) | | FileOutputHandler is an abstract base class for
OutputHandler subclasses that write RSS feed summaries to a
file. It consolidates common logic and configuration handling for such
classes, providing both consistent implementation and configuration.
See Also: OutputHandler See Also: org.clapper.curn.Curn See Also: org.clapper.curn.parser.RSSChannel version: $Revision: 7041 $ |
CFG_ENCODING | final public static String CFG_ENCODING(Code) | | Configuration variable: encoding
|
CFG_SAVED_BACKUPS | final public static String CFG_SAVED_BACKUPS(Code) | | Number of backups of saved files to keep.
|
CFG_SAVE_AS | final public static String CFG_SAVE_AS(Code) | | Where to save the output, if any
|
CFG_SAVE_ONLY | final public static String CFG_SAVE_ONLY(Code) | | Whether we're ONLY saving output
|
CFG_SHOW_CURN_INFO | final public static String CFG_SHOW_CURN_INFO(Code) | | Whether or not to show curn information
|
FileOutputHandler | public FileOutputHandler()(Code) | | Construct a new FileOutputHandler
|
copySubclassFields | protected void copySubclassFields(FileOutputHandler theCopy)(Code) | | Copy any subclass fields into a copy of this output handler.
Default version of this method does nothing.
Parameters: theCopy - copy of this class throws: CurnException - on error |
displayChannel | abstract public void displayChannel(RSSChannel channel, FeedInfo feedInfo) throws CurnException(Code) | | Display the list of RSSItem news items to whatever output
is defined for the underlying class. Output should be written to the
PrintWriter that was passed to the
FileOutputHandler.init init() method.
Parameters: channel - The parsed channel data Parameters: feedInfo - The feed. throws: CurnException - unable to write output |
displayToolInfo | final protected boolean displayToolInfo()(Code) | | Determine whether or not to display curn tool-related information in
the generated output. Subclasses are not required to display
tool-related information in the generated output, but if they do,
they are strongly encouraged to do so conditionally, based on the
value of this configuration item.
true if tool-related information is to be displayed(assuming the output handler supports it), or falseif tool-related information should be suppressed. |
getContentType | abstract public String getContentType()(Code) | | Get the content (i.e., MIME) type for output produced by this output
handler.
the content type |
getGeneratedOutput | final public File getGeneratedOutput() throws CurnException(Code) | | Get the File that represents the output produced by the
handler, if applicable. (Use of a File, rather than an
InputStream, is more efficient when mailing the output,
since the email API ultimately wants files and will create
temporary files for InputStreams.)
the output file, or null if no suitable output was produced throws: CurnException - an error occurred |
getName | public String getName()(Code) | | Get the name of this output handler. The name must be unique.
the name |
getOutputEncoding | public String getOutputEncoding()(Code) | | Get the output encoding.
the encoding |
getOutputFile | final protected File getOutputFile()(Code) | | Get the output file.
the output file, or none if not created yet |
init | final public void init(CurnConfig config, ConfiguredOutputHandler cfgHandler) throws ConfigurationException, CurnException(Code) | | Initializes the output handler for another set of RSS channels.
Parameters: config - the parsed curn configuration data Parameters: cfgHandler - the ConfiguredOutputHandler wrappercontaining this object; the wrapper has some usefulmetadata, such as the object's configuration sectionname and extra variables. throws: ConfigurationException - configuration error throws: CurnException - some other initialization error |
initOutputHandler | abstract public void initOutputHandler(CurnConfig config, ConfiguredOutputHandler cfgHandler) throws ConfigurationException, CurnException(Code) | | Perform any subclass-specific initialization. Subclasses must
override this method.
Parameters: config - the parsed curn configuration data Parameters: cfgHandler - the ConfiguredOutputHandler wrappercontaining this object; the wrapper has some usefulmetadata, such as the object's configuration sectionname and extra variables. throws: ConfigurationException - configuration error throws: CurnException - some other initialization error |
openOutputFile | protected PrintWriter openOutputFile() throws CurnException(Code) | | Open the output file, returning a PrintWriter. Handles
whether or not to roll the saved file, etc.
the PrintWriter throws: CurnException - unable to open file |
savingOutputOnly | final protected boolean savingOutputOnly()(Code) | | Determine whether the handler is saving output only, or also reporting
output to curn.
true if saving output only, false if alsoreporting File.createTempFile("curn", null);outputFile.deleteOnExit();output to curn |
|
|