ca.cbc.sportwire.servlet.data
Class FileFactory

java.lang.Object
  |
  +--ca.cbc.sportwire.servlet.data.FileFactory
All Implemented Interfaces:
GlobalCacheProperties, SportPageProperties

public class FileFactory
extends java.lang.Object
implements SportPageProperties, GlobalCacheProperties

FileFactory: Searches for a file from the configured paths and extension choices; used as a page var to expand the pathinfo in a template.

Created: Thu Jan 24 03:22:34 EST 2002
 $Log: FileFactory.java,v $
 Revision 1.2  2002/01/29 19:33:45  garym
 fixed concurrency bug with global config

 Revision 1.1  2002/01/24 19:50:20  garym
 Major restructuring of beans and pagehandlers


 

Version:
$Id: FileFactory.java,v 1.2 2002/01/29 19:33:45 garym Exp $
Author:
Gary Lawrence Murphy
See Also:
BioPageHandler, DocumentFile

Field Summary
(package private) static org.apache.log4j.Category cat
           
private static java.lang.String FILEFACTORY_PROPERTY
           
protected  org.apache.commons.collections.ExtendedProperties sc
           
 
Fields inherited from interface ca.cbc.sportwire.servlet.data.SportPageProperties
BEAN_SUFFIX, BEANFACTORY_VAR, CONTEXT_VAR, DATE_VAR, DEFAULT_EXTS, DEFAULT_INDEXES, DEFAULT_PAGE_SUFFIX, DEFAULT_SAX_DRIVER_CLASS, DEFAULT_TIMEZONE, DEFAULT_TOPIC, DOM_VAR, ERROR_TEMPLATE_VAR, EXCEPTION_VAR, EXTENSIONS_VAR, FALSE, GLOBAL_VAR, HOME_PROPERTY, INCLUDE_EXTS_PROPERTY, INCLUDE_VAR, INDEX_INDICATOR_VAR, INDEX_TEMPLATE_VAR, LAYOUT_TEMPLATE_VAR, MACRO_LIB_PROPERTY, MISSING_TEMPLATE_VAR, OUTPUT_VAR, PAGE_EXPIRE, PAGE_TEMPLATE_VAR, PANIC_404_PAGE, PANIC_404_PROPERTY, PANIC_500_PAGE, PANIC_500_PROPERTY, PARAM_PARSER_VAR, PATH_VAR, REQUEST_VAR, RESPONSE_VAR, SAX_CLASS_PROPERTY, SERVLET_DEBUG, SERVLET_LOGCONF_PROPERTY, SQL_SUFFIX, TEMPLATE_PATHS_PROPERTY, TIMEZONE_PROPERTY, TRUE, URI_VAR, VELOCITY_LOGFILE_DEFAULT, VELOCITY_LOGFILE_PROPERTY, XML_EXTS, XML_EXTS_PROPERTY, XML_PATHS_PROPERTY, XML_SUFFIX, XSL_EXTS, XSL_EXTS_PROPERTY, XSL_PATHS_PROPERTY
 
Fields inherited from interface ca.cbc.sportwire.servlet.data.GlobalCacheProperties
CACHE_DEFAULT_PERIOD, CACHE_DEFAULT_TIMEOUT, CACHE_PERIOD, CACHE_TIMEOUT, MRU_PROPERTY, MRU_VAR, TTL_PROPERTY, TTL_VAR
 
Constructor Summary
private FileFactory(org.apache.commons.collections.ExtendedProperties sc)
           
 
Method Summary
 java.lang.String find(PathList pathinfo)
           
 java.lang.String find(java.lang.String pathinfo)
          find returns the filename is searched for in the templates.home directories; if the file is not found, a null is returned and the trouble logged.
static FileFactory getInstance(org.apache.commons.collections.ExtendedProperties sc)
          getInstance: returns a factory for use in a template
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

cat

static org.apache.log4j.Category cat

FILEFACTORY_PROPERTY

private static final java.lang.String FILEFACTORY_PROPERTY

sc

protected org.apache.commons.collections.ExtendedProperties sc
Constructor Detail

FileFactory

private FileFactory(org.apache.commons.collections.ExtendedProperties sc)
Method Detail

getInstance

public static FileFactory getInstance(org.apache.commons.collections.ExtendedProperties sc)
getInstance: returns a factory for use in a template
Returns:
the FileFactory value

find

public java.lang.String find(PathList pathinfo)

find

public java.lang.String find(java.lang.String pathinfo)
find returns the filename is searched for in the templates.home directories; if the file is not found, a null is returned and the trouble logged. The filename returned is relative to the template paths so it can be used with Velocity parse and include functions.
Parameters:
pathinfo - a String filename value
Returns:
a File value or null if there were problems