Class PathScanningMatcher

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean caseSensitive
      Whether or not the file system should be treated as a case sensitive one.
      protected java.util.List<java.lang.String> includePatterns
      The patterns for the files to be included.
      protected java.lang.String separator
      The file separator to use to parse paths - default=local O/S separator
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected PathScanningMatcher()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean couldHoldIncluded​(java.lang.String name)
      Tests whether or not a name matches the start of at least one include pattern.
      java.util.List<java.lang.String> getIncludes()  
      java.lang.String getSeparator()  
      boolean isCaseSensitive()  
      protected boolean isIncluded​(java.lang.String name)
      Tests whether or not a name matches against at least one include pattern.
      static java.lang.String normalizePattern​(java.lang.String pattern)
      Normalizes the pattern, e.g.
      void setCaseSensitive​(boolean caseSensitive)  
      void setIncludes​(java.lang.String... includes)
      Sets the list of include patterns to use.
      void setIncludes​(java.util.Collection<java.lang.String> includes)  
      void setSeparator​(java.lang.String separator)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • caseSensitive

        protected boolean caseSensitive
        Whether or not the file system should be treated as a case sensitive one.
      • separator

        protected java.lang.String separator
        The file separator to use to parse paths - default=local O/S separator
      • includePatterns

        protected java.util.List<java.lang.String> includePatterns
        The patterns for the files to be included.
    • Constructor Detail

      • PathScanningMatcher

        protected PathScanningMatcher()
    • Method Detail

      • setIncludes

        public void setIncludes​(java.lang.String... includes)

        Sets the list of include patterns to use. All '/' and '\' characters are replaced by File.separatorChar, so the separator used need not match File.separatorChar.

        When a pattern ends with a '/' or '\', "**" is appended.

        Parameters:
        includes - A list of include patterns. May be null, indicating that all files should be included. If a non-null list is given, all elements must be non-null.
      • getIncludes

        public java.util.List<java.lang.String> getIncludes()
        Returns:
        Un-modifiable list of the inclusion patterns
      • setIncludes

        public void setIncludes​(java.util.Collection<java.lang.String> includes)
      • isCaseSensitive

        public boolean isCaseSensitive()
        Returns:
        Whether or not the file system should be treated as a case sensitive one.
      • setCaseSensitive

        public void setCaseSensitive​(boolean caseSensitive)
      • getSeparator

        public java.lang.String getSeparator()
        Returns:
        The file separator to use to parse paths - default=local O/S separator
      • setSeparator

        public void setSeparator​(java.lang.String separator)
      • isIncluded

        protected boolean isIncluded​(java.lang.String name)
        Tests whether or not a name matches against at least one include pattern.
        Parameters:
        name - The name to match. Must not be null.
        Returns:
        true when the name matches against at least one include pattern, or false otherwise.
      • couldHoldIncluded

        protected boolean couldHoldIncluded​(java.lang.String name)
        Tests whether or not a name matches the start of at least one include pattern.
        Parameters:
        name - The name to match. Must not be null.
        Returns:
        true when the name matches against the start of at least one include pattern, or false otherwise.
      • normalizePattern

        public static java.lang.String normalizePattern​(java.lang.String pattern)
        Normalizes the pattern, e.g. converts forward and backward slashes to the platform-specific file separator.
        Parameters:
        pattern - The pattern to normalize, must not be null.
        Returns:
        The normalized pattern, never null.