FileNameGlobMatcher (FreeMarker 2.3.35 API)
Description: declaration: package: freemarker.cache, class: FileNameGlobMatcher

Package freemarker.cache

# Class FileNameGlobMatcher

java.lang.Object
freemarker.cache.TemplateSourceMatcher
freemarker.cache.FileNameGlobMatcher

public class FileNameGlobMatcher extends TemplateSourceMatcher
As opposed to `PathGlobMatcher`, 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 `*.ftlh` matches both `foo.ftlh` and `foo/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​(String glob)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `FileNameGlobMatcher`
  `caseInsensitive​(boolean caseInsensitive)`
  Fluid API variation of `setCaseInsensitive(boolean)`
  `boolean`
  `isCaseInsensitive()`
  `boolean`
  `matches​(String sourceName, Object templateSource)`
  `void`
  `setCaseInsensitive​(boolean caseInsensitive)`
  Sets if the matching will be case-insensitive (UNICODE compliant); default is `false`.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### FileNameGlobMatcher

    public FileNameGlobMatcher​(String glob)
    Parameters:
      `glob` - Glob with the syntax defined by `StringUtil.globToRegularExpression(String, boolean)`. Must not start with `/`.

- ## Method Details

  - ### matches

    public boolean matches​(String sourceName, Object templateSource) throws IOException
    Throws:
      `IOException`

  - ### isCaseInsensitive

    public boolean isCaseInsensitive()

  - ### setCaseInsensitive

    public void setCaseInsensitive​(boolean caseInsensitive)
    Sets if the matching will be case-insensitive (UNICODE compliant); default is `false`.

  - ### caseInsensitive

    public FileNameGlobMatcher caseInsensitive​(boolean caseInsensitive)
    Fluid API variation of `setCaseInsensitive(boolean)`