public class DefaultFilePredicates extends Object implements FilePredicates
FilePredicate| Modifier and Type | Method and Description |
|---|---|
FilePredicate |
all()
Returns a predicate that always evaluates to true
|
FilePredicate |
and(Collection<FilePredicate> and) |
FilePredicate |
and(FilePredicate... and) |
FilePredicate |
and(FilePredicate first,
FilePredicate second) |
FilePredicate |
doesNotMatchPathPattern(String exclusionPattern)
Predicate that gets the files that do not match the given wildcard pattern.
|
FilePredicate |
doesNotMatchPathPatterns(String[] exclusionPatterns)
Predicate that gets the files that do not match any of the given wildcard patterns.
|
FilePredicate |
hasAbsolutePath(String s)
Predicate that gets a file by its absolute path.
|
FilePredicate |
hasLanguage(String language) |
FilePredicate |
hasLanguages(Collection<String> languages) |
FilePredicate |
hasLanguages(String... languages) |
FilePredicate |
hasPath(String s)
if the parameter represents an absolute path for the running environment, then
returns
FilePredicates.hasAbsolutePath(String), else FilePredicates.hasRelativePath(String) |
FilePredicate |
hasRelativePath(String s)
non-normalized path and Windows-style path are supported
|
FilePredicate |
hasStatus(InputFile.Status status) |
FilePredicate |
hasType(InputFile.Type type) |
FilePredicate |
is(File ioFile) |
FilePredicate |
matchesPathPattern(String inclusionPattern)
Predicate that gets the files which relative or absolute path matches a wildcard pattern.
|
FilePredicate |
matchesPathPatterns(String[] inclusionPatterns)
Predicate that gets the files matching at least one wildcard pattern.
|
FilePredicate |
none()
Returns a predicate that always evaluates to false
|
FilePredicate |
not(FilePredicate p) |
FilePredicate |
or(Collection<FilePredicate> or) |
FilePredicate |
or(FilePredicate... or) |
FilePredicate |
or(FilePredicate first,
FilePredicate second) |
public FilePredicate all()
all in interface FilePredicatespublic FilePredicate none()
none in interface FilePredicatespublic FilePredicate hasAbsolutePath(String s)
FilePredicates/path/to/../foo.txt is same as /path/foo.txt).
Warning - not efficient because absolute path is not indexed yet.
hasAbsolutePath in interface FilePredicatespublic FilePredicate hasRelativePath(String s)
hasRelativePath in interface FilePredicatespublic FilePredicate matchesPathPattern(String inclusionPattern)
FilePredicatesfile:, then absolute path is used, else relative path. Pattern
is case-sensitive, except for file extension.
* and **, but not ?.
**/*Foo.java matches Foo.java, src/Foo.java and src/java/SuperFoo.java**/*Foo*.java matches src/Foo.java, src/BarFoo.java, src/FooBar.java
and src/BarFooBaz.java**/*FOO.JAVA matches FOO.java and FOO.JAVA but not Foo.javafile:**/src/*Foo.java matches /path/to/src/Foo.java on unix and c:\path\to\Foo.java on MSWindowsmatchesPathPattern in interface FilePredicatespublic FilePredicate matchesPathPatterns(String[] inclusionPatterns)
FilePredicatesFilePredicates.all().matchesPathPatterns in interface FilePredicatesFilePredicates.matchesPathPattern(String)public FilePredicate doesNotMatchPathPattern(String exclusionPattern)
FilePredicatesdoesNotMatchPathPattern in interface FilePredicatesFilePredicates.matchesPathPattern(String)public FilePredicate doesNotMatchPathPatterns(String[] exclusionPatterns)
FilePredicatesFilePredicates.all().doesNotMatchPathPatterns in interface FilePredicatesFilePredicates.matchesPathPattern(String)public FilePredicate hasPath(String s)
FilePredicatesFilePredicates.hasAbsolutePath(String), else FilePredicates.hasRelativePath(String)hasPath in interface FilePredicatespublic FilePredicate is(File ioFile)
is in interface FilePredicatespublic FilePredicate hasLanguage(String language)
hasLanguage in interface FilePredicatespublic FilePredicate hasLanguages(Collection<String> languages)
hasLanguages in interface FilePredicatespublic FilePredicate hasLanguages(String... languages)
hasLanguages in interface FilePredicatespublic FilePredicate hasStatus(InputFile.Status status)
hasStatus in interface FilePredicatespublic FilePredicate hasType(InputFile.Type type)
hasType in interface FilePredicatespublic FilePredicate not(FilePredicate p)
not in interface FilePredicatespublic FilePredicate or(Collection<FilePredicate> or)
or in interface FilePredicatespublic FilePredicate or(FilePredicate... or)
or in interface FilePredicatespublic FilePredicate or(FilePredicate first, FilePredicate second)
or in interface FilePredicatespublic FilePredicate and(Collection<FilePredicate> and)
and in interface FilePredicatespublic FilePredicate and(FilePredicate... and)
and in interface FilePredicatespublic FilePredicate and(FilePredicate first, FilePredicate second)
and in interface FilePredicatesCopyright © 2009–2017 SonarSource. All rights reserved.