Class 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 Detail

      • FileExtensionMatcher

        public FileExtensionMatcher​(java.lang.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 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 is true.