org.onemind.jxp
Class FilePageSource

java.lang.Object
  extended by org.onemind.jxp.JxpPageSource
      extended by org.onemind.jxp.CachingPageSource
          extended by org.onemind.jxp.FilePageSource

public class FilePageSource
extends CachingPageSource

Represents a JxpPageSource using the file system

Author:
TiongHiang Lee (thlee@onemindsoft.org)

Field Summary
private  boolean _modCheck
          do modification check
private  java.lang.String _pathPrefix
          the path prefix *
 
Constructor Summary
FilePageSource(java.lang.String pathPrefix)
          Constructor
FilePageSource(java.lang.String pathPrefix, java.lang.String encoding)
          Constructor
 
Method Summary
 boolean getModCheck()
          Return whether doing file modification check
 java.lang.String getPathPrefix()
          Return the pathPrefix
 java.lang.String getStreamName(java.lang.String pageName)
          
protected  boolean hasStream(java.lang.String pageName)
          Whether there's input stream from given page name
protected  boolean isExpired(CachedJxpPage page)
          Whether a page is expired
protected  java.io.InputStream loadStream(CachedJxpPage page)
          Load the input stream for the page
 void setModCheck(boolean b)
          Set whether to do file modification check
 void setPathPrefix(java.lang.String pathPrefix)
          Set the pathPrefix
 
Methods inherited from class org.onemind.jxp.CachingPageSource
assignPageStaticVariable, declarePageStaticVariable, getEncoding, getErrorSource, getJxpDocument, getJxpPage, getPageStaticVariable, hasJxpPage, hasPageStaticVariable, invalidatePageCache, isCaching, isJxpPageCached, purgeStaticVariables, setCaching, setEncoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_modCheck

private boolean _modCheck
do modification check


_pathPrefix

private java.lang.String _pathPrefix
the path prefix *

Constructor Detail

FilePageSource

public FilePageSource(java.lang.String pathPrefix)
Constructor

Parameters:
pathPrefix - the prefix

FilePageSource

public FilePageSource(java.lang.String pathPrefix,
                      java.lang.String encoding)
Constructor

Parameters:
pathPrefix - the path prefix
encoding - the encoding
Method Detail

getStreamName

public final java.lang.String getStreamName(java.lang.String pageName)


getPathPrefix

public final java.lang.String getPathPrefix()
Return the pathPrefix

Returns:
the pathPrefix.

setPathPrefix

public final void setPathPrefix(java.lang.String pathPrefix)
Set the pathPrefix

Parameters:
pathPrefix - The pathPrefix to set.

getModCheck

public boolean getModCheck()
Return whether doing file modification check

Returns:
true if modification check is turned on

setModCheck

public void setModCheck(boolean b)
Set whether to do file modification check

Parameters:
b - true to turn on modification check

isExpired

protected boolean isExpired(CachedJxpPage page)
Whether a page is expired

Specified by:
isExpired in class CachingPageSource
Parameters:
page - the page
Returns:
true if expired

hasStream

protected boolean hasStream(java.lang.String pageName)
Whether there's input stream from given page name

Specified by:
hasStream in class CachingPageSource
Parameters:
pageName - the page name
Returns:
true if has input stream

loadStream

protected java.io.InputStream loadStream(CachedJxpPage page)
                                  throws java.io.IOException
Load the input stream for the page

Specified by:
loadStream in class CachingPageSource
Returns:
the input stream
Throws:
java.io.IOException