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

Package freemarker.cache

# Class FileExtensionMatcher

java.lang.Object
freemarker.cache.TemplateSourceMatcher
freemarker.cache.FileExtensionMatcher

public class FileExtensionMatcher extends TemplateSourceMatcher
Matches the file extension; unlike other matchers, by default case insensitive. A name (a path) is considered to have the given extension exactly if it ends with a dot plus the extension.

Since:
  2.3.24

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FileExtensionMatcher​(String extension)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `FileExtensionMatcher`
  `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 `true`.

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

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

- ## Constructor Details

  - ### FileExtensionMatcher

    public FileExtensionMatcher​(String extension)
    Parameters:
      `extension` - The file extension (without the initial dot). Can't contain there characters: `'/'`, `'*'`, `'?'`. May contains `'.'`, but can't start with it.

- ## 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 `true`.

  - ### caseInsensitive

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