Package freemarker.cache
Class FileNameGlobMatcher
- java.lang.Object
-
- freemarker.cache.TemplateSourceMatcher
-
- freemarker.cache.FileNameGlobMatcher
-
public class FileNameGlobMatcher extends TemplateSourceMatcher
As opposed toPathGlobMatcher, it only compares the "file name" part (the part after the last/) of the source name with the given glob. For example, the file name glob*.ftlhmatches bothfoo.ftlhandfoo/bar.ftlh. With other words, that file name glob is equivalent with the**/*.ftlh) path glob (PathGlobMatcher).- Since:
- 2.3.24
-
-
Constructor Summary
Constructors Constructor Description FileNameGlobMatcher(java.lang.String glob)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileNameGlobMatchercaseInsensitive(boolean caseInsensitive)Fluid API variation ofsetCaseInsensitive(boolean)booleanisCaseInsensitive()booleanmatches(java.lang.String sourceName, java.lang.Object templateSource)voidsetCaseInsensitive(boolean caseInsensitive)Sets if the matching will be case insensitive (UNICODE compliant); default isfalse.
-
-
-
Constructor Detail
-
FileNameGlobMatcher
public FileNameGlobMatcher(java.lang.String glob)
- Parameters:
glob- Glob with the syntax defined byStringUtil.globToRegularExpression(String, boolean). Must not start with/.
-
-
Method Detail
-
matches
public boolean matches(java.lang.String sourceName, java.lang.Object templateSource) throws java.io.IOException- Throws:
java.io.IOException
-
isCaseInsensitive
public boolean isCaseInsensitive()
-
setCaseInsensitive
public void setCaseInsensitive(boolean caseInsensitive)
Sets if the matching will be case insensitive (UNICODE compliant); default isfalse.
-
caseInsensitive
public FileNameGlobMatcher caseInsensitive(boolean caseInsensitive)
Fluid API variation ofsetCaseInsensitive(boolean)
-
-