Package org.apache.catalina.ssi
Class SSIMediator
- java.lang.Object
-
- org.apache.catalina.ssi.SSIMediator
-
public class SSIMediator extends Object
Allows the different SSICommand implementations to share data/talk to each other- Author:
- Bip Thelin, Amy Roh, Paul Speed, Dan Sandberg, David Becker
-
-
Field Summary
Fields Modifier and Type Field Description protected StringclassNameprotected org.apache.catalina.ssi.SSIConditionalStateconditionalStateprotected StringconfigErrMsgprotected StringconfigSizeFmtprotected StringconfigTimeFmtprotected static StringDEFAULT_CONFIG_ERR_MSGprotected static StringDEFAULT_CONFIG_SIZE_FMTprotected static StringDEFAULT_CONFIG_TIME_FMTprotected static StringENCODING_ENTITYprotected static StringENCODING_NONEprotected static StringENCODING_URLprotected intlastMatchCountprotected longlastModifiedDateprotected SSIExternalResolverssiExternalResolverprotected Strftimestrftime
-
Constructor Summary
Constructors Constructor Description SSIMediator(SSIExternalResolver ssiExternalResolver, long lastModifiedDate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclearMatchGroups()protected Stringencode(String value, String encoding)protected StringformatDate(Date date, TimeZone timeZone)org.apache.catalina.ssi.SSIConditionalStategetConditionalState()StringgetConfigErrMsg()StringgetConfigSizeFmt()StringgetConfigTimeFmt()longgetFileLastModified(String path, boolean virtual)longgetFileSize(String path, boolean virtual)StringgetFileText(String path, boolean virtual)Collection<String>getVariableNames()StringgetVariableValue(String variableName)StringgetVariableValue(String variableName, String encoding)protected booleanisNameReserved(String name)voidlog(String message)voidlog(String message, Throwable throwable)protected voidpopulateMatchGroups(Matcher matcher)voidsetConfigErrMsg(String configErrMsg)voidsetConfigSizeFmt(String configSizeFmt)voidsetConfigTimeFmt(String configTimeFmt)voidsetConfigTimeFmt(String configTimeFmt, boolean fromConstructor)protected voidsetDateVariables(boolean fromConstructor)voidsetVariableValue(String variableName, String variableValue)StringsubstituteVariables(String val)Applies variable substitution to the specified String and returns the new resolved string.
-
-
-
Field Detail
-
ENCODING_NONE
protected static final String ENCODING_NONE
- See Also:
- Constant Field Values
-
ENCODING_ENTITY
protected static final String ENCODING_ENTITY
- See Also:
- Constant Field Values
-
ENCODING_URL
protected static final String ENCODING_URL
- See Also:
- Constant Field Values
-
DEFAULT_CONFIG_ERR_MSG
protected static final String DEFAULT_CONFIG_ERR_MSG
- See Also:
- Constant Field Values
-
DEFAULT_CONFIG_TIME_FMT
protected static final String DEFAULT_CONFIG_TIME_FMT
- See Also:
- Constant Field Values
-
DEFAULT_CONFIG_SIZE_FMT
protected static final String DEFAULT_CONFIG_SIZE_FMT
- See Also:
- Constant Field Values
-
configErrMsg
protected String configErrMsg
-
configTimeFmt
protected String configTimeFmt
-
configSizeFmt
protected String configSizeFmt
-
className
protected final String className
-
ssiExternalResolver
protected final SSIExternalResolver ssiExternalResolver
-
lastModifiedDate
protected final long lastModifiedDate
-
strftime
protected Strftime strftime
-
conditionalState
protected final org.apache.catalina.ssi.SSIConditionalState conditionalState
-
lastMatchCount
protected int lastMatchCount
-
-
Constructor Detail
-
SSIMediator
public SSIMediator(SSIExternalResolver ssiExternalResolver, long lastModifiedDate)
-
-
Method Detail
-
setConfigErrMsg
public void setConfigErrMsg(String configErrMsg)
-
setConfigTimeFmt
public void setConfigTimeFmt(String configTimeFmt)
-
setConfigTimeFmt
public void setConfigTimeFmt(String configTimeFmt, boolean fromConstructor)
-
setConfigSizeFmt
public void setConfigSizeFmt(String configSizeFmt)
-
getConfigErrMsg
public String getConfigErrMsg()
-
getConfigTimeFmt
public String getConfigTimeFmt()
-
getConfigSizeFmt
public String getConfigSizeFmt()
-
getConditionalState
public org.apache.catalina.ssi.SSIConditionalState getConditionalState()
-
getVariableNames
public Collection<String> getVariableNames()
-
getFileSize
public long getFileSize(String path, boolean virtual) throws IOException
- Throws:
IOException
-
getFileLastModified
public long getFileLastModified(String path, boolean virtual) throws IOException
- Throws:
IOException
-
getFileText
public String getFileText(String path, boolean virtual) throws IOException
- Throws:
IOException
-
isNameReserved
protected boolean isNameReserved(String name)
-
substituteVariables
public String substituteVariables(String val)
Applies variable substitution to the specified String and returns the new resolved string.- Parameters:
val- The value which should be checked- Returns:
- the value after variable substitution
-
log
public void log(String message)
-
setDateVariables
protected void setDateVariables(boolean fromConstructor)
-
clearMatchGroups
protected void clearMatchGroups()
-
populateMatchGroups
protected void populateMatchGroups(Matcher matcher)
-
-