public class FileMatcher extends Object
Modifier and Type | Method and Description |
---|---|
static FileMatcher |
createMatcher(Collection<String> includes,
Collection<String> excludes) |
static FileMatcher |
createMatcher(Path basedir,
Collection<String> includes,
Collection<String> excludes)
Creates and returns new matcher for files under specified
basedir that satisfy
specified includes/excludes patterns. |
static Map<String,FileMatcher> |
createMatchers(Collection<String> includes,
Collection<String> excludes)
Returns a map of location to FileMatcher that will optimize the lookup.
|
static Map<Path,FileMatcher> |
createMatchers(Path basedir,
Collection<String> includes,
Collection<String> excludes)
Given a directory, returns a map of location to FileMatcher that will optimize the lookup.
|
boolean |
matches(File file) |
boolean |
matches(Path file) |
boolean |
matches(String path)
Returns
true if provided path is under this matcher's basedir and satisfies
includes/excludes patterns. |
protected static String |
toDirectoryPath(String basepath) |
public boolean matches(String path)
true
if provided path is under this matcher's basedir and satisfies
includes/excludes patterns. The provided path is assumed to be normalized according to
PathNormalizer.normalize0(Path)
.public boolean matches(Path file)
public boolean matches(File file)
public static Map<Path,FileMatcher> createMatchers(Path basedir, Collection<String> includes, Collection<String> excludes)
public static Map<String,FileMatcher> createMatchers(Collection<String> includes, Collection<String> excludes)
public static FileMatcher createMatcher(Path basedir, Collection<String> includes, Collection<String> excludes)
basedir
that satisfy
specified includes/excludes patterns.public static FileMatcher createMatcher(Collection<String> includes, Collection<String> excludes)
Copyright © 2021. All rights reserved.