Class AntPathMatcherFilter

java.lang.Object
com.isomorphic.maven.util.AntPathMatcherFilter

public class AntPathMatcherFilter
extends Object
Provides a mechanism to see whether or not a String path is matched by one or more ant-style patterns.
  • Constructor Details

    • AntPathMatcherFilter

      public AntPathMatcherFilter()
      Default constructor whose behavior is to include all files.
    • AntPathMatcherFilter

      public AntPathMatcherFilter​(String includes, String excludes)
      Allows the specification of one or more patterns for inclusion and/or exclusion.
      Parameters:
      includes - a comma-separated list of patterns to be included in matching
      excludes - a comma-separated list of patterns to be excluded from matching
  • Method Details

    • include

      public AntPathMatcherFilter include​(String patterns)
      Add the given patterns to the current list of inclusions.
      Parameters:
      patterns - a comma-separated list of patterns to be included in matching
      Returns:
      this AntPathMatcherFilter instance, in fluid interface style
    • exclude

      public AntPathMatcherFilter exclude​(String patterns)
      Add the given patterns to the current list of exclusions.
      Parameters:
      patterns - a comma-separated list of patterns to be excluded from matching
      Returns:
      this AntPathMatcherFilter instance, in fluid interface style
    • accept

      public boolean accept​(String path)
      Returns false if path matches any exclusion, otherwise evaluates each inclusion ti see whether any of them match and returns true if so.
      Parameters:
      path - The path to be matched
      Returns:
      true if path matches one or more inclusions and no exclusions
    • copy

      public AntPathMatcherFilter copy()
      Copies this object's inclusions and exclusions to a new instance.
      Returns:
      a new AntPathMAtcherFilter instance with copies of this instance's inclusions and exclusions