Package com.jalios.jcms.tools
Class AbstractChecker
- java.lang.Object
-
- com.jalios.jcms.tools.AbstractChecker
-
- Direct Known Subclasses:
FormHandlerChecker,HbmChecker,JPropertiesChecker,JsChecker,JspChecker,LangPropertiesChecker,LessChecker,RightPolicyFilterChecker,TypeChecker
public abstract class AbstractChecker extends java.lang.ObjectCommon parent class for validation checkers.- Since:
- jcms-8.0.3, jcms-9.0
- Author:
- Sylvain Devaux
-
-
Field Summary
Fields Modifier and Type Field Description protected static ChannelCHANNELprotected static org.apache.commons.io.filefilter.SuffixFileFilterPROP_SUFFIX_FILE_FILTER
-
Constructor Summary
Constructors Constructor Description AbstractChecker()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static CheckedFilegetCheckedFile(java.io.File webappDir, java.io.File file)protected static java.util.List<java.io.File>getFileList(java.io.File webappDir, java.lang.String extension)protected static java.util.List<java.io.File>getFileList(java.io.File webappDir, java.lang.String extension, java.util.List<java.util.regex.Pattern> ignoreFilePatterns, java.util.List<java.lang.String> ignoredDirectories)static LangPropertiesloadLanguageProperties(java.io.File webappDir)static LangPropertiesloadProperties(java.io.File webappDir)Loads all plugins' plugin.prop, custom.prop, and jcms.prop.static LangPropertiesloadProperties(java.io.File webappDir, org.apache.commons.io.filefilter.IOFileFilter fileFilter)Loads all plugins' plugin.prop, custom.prop, and jcms.prop, filtering on given fileFilter.
Only accept *.prop file.protected static voidsaveError(CheckResult result, java.lang.String msg, org.apache.log4j.Logger logger)Logs the msg as warning Level, and append it to the global CheckResult object.
-
-
-
Field Detail
-
CHANNEL
protected static final Channel CHANNEL
-
PROP_SUFFIX_FILE_FILTER
protected static final org.apache.commons.io.filefilter.SuffixFileFilter PROP_SUFFIX_FILE_FILTER
-
-
Method Detail
-
saveError
protected static void saveError(CheckResult result, java.lang.String msg, org.apache.log4j.Logger logger)
Logs the msg as warning Level, and append it to the global CheckResult object.- Parameters:
result- the global check result.msg- the error descriptionlogger- the logger to use for warning- Since:
- jcms-8.0.3, jcms-9.0.0
-
loadProperties
public static LangProperties loadProperties(java.io.File webappDir) throws java.io.IOException
Loads all plugins' plugin.prop, custom.prop, and jcms.prop.- Parameters:
webappDir- the webapp dir to load properties from.- Returns:
- loaded properties
- Throws:
java.io.IOException- if an exception occurs while loading properties
-
loadProperties
public static LangProperties loadProperties(java.io.File webappDir, org.apache.commons.io.filefilter.IOFileFilter fileFilter) throws java.io.IOException
Loads all plugins' plugin.prop, custom.prop, and jcms.prop, filtering on given fileFilter.
Only accept *.prop file.- Parameters:
webappDir- the webapp dir to load properties from.fileFilter- an optional user FileFilter to escape property file(s) (add is not possible since we use aAndFileFiltercomputation)- Returns:
- loaded properties
- Throws:
java.io.IOException- if an exception occurs while loading properties
-
loadLanguageProperties
public static LangProperties loadLanguageProperties(java.io.File webappDir) throws java.io.IOException
- Throws:
java.io.IOException
-
getCheckedFile
protected static CheckedFile getCheckedFile(java.io.File webappDir, java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
getFileList
protected static java.util.List<java.io.File> getFileList(java.io.File webappDir, java.lang.String extension)
-
getFileList
protected static java.util.List<java.io.File> getFileList(java.io.File webappDir, java.lang.String extension, java.util.List<java.util.regex.Pattern> ignoreFilePatterns, java.util.List<java.lang.String> ignoredDirectories)
-
-