public class WatchmanGlobber extends Object
The implementation is mostly compatible with glob_watchman.py and as such differs from the
NativeGlobber
in certain ways:
Modifier and Type | Class and Description |
---|---|
static class |
WatchmanGlobber.Option
Watchman options to use when globbing.
|
Modifier and Type | Method and Description |
---|---|
static WatchmanGlobber |
create(WatchmanClient watchmanClient,
SyncCookieState syncCookieState,
String basePath,
String watchmanWatchRoot)
Factory method for creating
WatchmanGlobber instances. |
Optional<com.google.common.collect.ImmutableSet<String>> |
run(Collection<String> include,
Collection<String> exclude,
boolean excludeDirectories) |
Optional<com.google.common.collect.ImmutableSet<String>> |
run(Collection<String> include,
Collection<String> exclude,
EnumSet<WatchmanGlobber.Option> options) |
Optional<com.google.common.collect.ImmutableSet<String>> |
run(Collection<String> include,
Collection<String> exclude,
WatchmanGlobber.Option option) |
public Optional<com.google.common.collect.ImmutableSet<String>> run(Collection<String> include, Collection<String> exclude, boolean excludeDirectories) throws IOException, InterruptedException
include
- File patterns that should be included in the resulting set.exclude
- File patterns that should be excluded from the resulting set.excludeDirectories
- Whether directories should be excluded from the resulting set.IOException
InterruptedException
run(Collection, Collection, EnumSet)
public Optional<com.google.common.collect.ImmutableSet<String>> run(Collection<String> include, Collection<String> exclude, WatchmanGlobber.Option option) throws IOException, InterruptedException
IOException
InterruptedException
public Optional<com.google.common.collect.ImmutableSet<String>> run(Collection<String> include, Collection<String> exclude, EnumSet<WatchmanGlobber.Option> options) throws IOException, InterruptedException, WatchmanQueryFailedException
include
- File patterns that should be included in the resulting set.exclude
- File patterns that should be excluded from the resulting set.options
- Customizations for matching behavior.WatchmanQueryFailedException
- Watchman returned an error response.IOException
InterruptedException
public static WatchmanGlobber create(WatchmanClient watchmanClient, SyncCookieState syncCookieState, String basePath, String watchmanWatchRoot)
WatchmanGlobber
instances.basePath
- The base path relative to which paths matching glob patterns will be resolved.