Groovy Documentation

org.gradle.api.tasks.util
[Java] Interface PatternFilterable


public interface PatternFilterable

A PatternFilterable represents some file container which Ant-style include and exclude patterns or specs can be applied to.

Patterns may include:

Either '/' or '\' may be used in a pattern to separate directories. Patterns ending with '/' or '\' will have '**' automatically appended.

Examples:

 all files ending with 'jsp' (including subdirectories)
    **/*.jsp

 all files beginning with 'template_' in the level1/level2 directory
    level1/level2/template_*

 all files (including subdirectories) beneath src/main/webapp
   src/main/webapp/

 all files beneath any .svn directory (including subdirectories) under src/main/java
   src/main/java/**/.svn/**
 

You may also use a closure or Spec to specify which files to include or exclude. The closure or Spec is passed a FileTreeElement, and must return a boolean value.

If no include patterns or specs are specified, then all files in this container will be included. If any include patterns or specs are specified, then a file is included if it matches any of the patterns or specs.

If no exclude patterns or spec are specified, then no files will be excluded. If any exclude patterns or specs are specified, then a file is include only if it matches none of the patterns or specs.


Groovy Documentation