| Modifier and Type | Field and Description |
|---|---|
static int |
UNLIMITED_DEPTH |
| Constructor and Description |
|---|
Config(Path path) |
Config(Path path,
PathWatcher.Config parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
addExclude(PathMatcher matcher)
Add an exclude PathMatcher
|
void |
addExclude(String syntaxAndPattern)
Add an exclude PathMatcher.
|
void |
addExcludeGlobRelative(String pattern)
Add a
glob: syntax pattern exclude reference in a directory relative, os neutral, pattern. |
void |
addExcludeHidden()
Exclude hidden files and hidden directories
|
void |
addExcludes(List<String> syntaxAndPatterns)
Add multiple exclude PathMatchers
|
void |
addInclude(PathMatcher matcher)
Add an include PathMatcher
|
void |
addInclude(String syntaxAndPattern)
Add an include PathMatcher
|
void |
addIncludeGlobRelative(String pattern)
Add a
glob: syntax pattern reference in a directory relative, os neutral, pattern. |
void |
addIncludes(List<String> syntaxAndPatterns)
Add multiple include PathMatchers
|
PathWatcher.Config |
asSubConfig(Path dir)
Build a new config from a this configuration.
|
PathWatcher.Config |
getParent() |
Path |
getPath() |
int |
getRecurseDepth() |
boolean |
isHidden(Path path) |
boolean |
isPaused(long now) |
boolean |
isRecurseDepthUnlimited() |
Path |
resolve(Path path) |
void |
setPauseUntil(long time) |
void |
setRecurseDepth(int depth)
Set the recurse depth for the directory scanning.
|
boolean |
test(Path path) |
String |
toShortPath(Path path) |
String |
toString() |
public static final int UNLIMITED_DEPTH
public Config(Path path)
public Config(Path path, PathWatcher.Config parent)
public PathWatcher.Config getParent()
public void setPauseUntil(long time)
public boolean isPaused(long now)
public void addExclude(PathMatcher matcher)
matcher - the path matcher for this excludepublic void addExclude(String syntaxAndPattern)
Note: this pattern is FileSystem specific (so use "/" for Linux and OSX, and "\\" for Windows)
syntaxAndPattern - the PathMatcher syntax and pattern to usefor detail on syntax and patternpublic void addExcludeGlobRelative(String pattern)
glob: syntax pattern exclude reference in a directory relative, os neutral, pattern.
On Linux:
Config config = new Config(Path("/home/user/example"));
config.addExcludeGlobRelative("*.war") => "glob:/home/user/example/*.war"
On Windows
Config config = new Config(Path("D:/code/examples"));
config.addExcludeGlobRelative("*.war") => "glob:D:\\code\\examples\\*.war"
pattern - the pattern, in unixy format, relative to config.dirpublic void addExcludeHidden()
public void addExcludes(List<String> syntaxAndPatterns)
syntaxAndPatterns - the list of PathMatcher syntax and patterns to usefor detail on syntax and patternpublic void addInclude(PathMatcher matcher)
matcher - the path matcher for this includepublic void addInclude(String syntaxAndPattern)
syntaxAndPattern - the PathMatcher syntax and pattern to usefor detail on syntax and patternpublic void addIncludeGlobRelative(String pattern)
glob: syntax pattern reference in a directory relative, os neutral, pattern.
On Linux:
Config config = new Config(Path("/home/user/example"));
config.addIncludeGlobRelative("*.war") => "glob:/home/user/example/*.war"
On Windows
Config config = new Config(Path("D:/code/examples"));
config.addIncludeGlobRelative("*.war") => "glob:D:\\code\\examples\\*.war"
pattern - the pattern, in unixy format, relative to config.dirpublic void addIncludes(List<String> syntaxAndPatterns)
syntaxAndPatterns - the list of PathMatcher syntax and patterns to usefor detail on syntax and patternpublic PathWatcher.Config asSubConfig(Path dir)
Useful for working with sub-directories that also need to be watched.
dir - the directory to build new Config from (using this config as source of includes/excludes)public int getRecurseDepth()
public boolean isRecurseDepthUnlimited()
public Path getPath()
public void setRecurseDepth(int depth)
-999 indicates arbitrarily deep recursion, 0 indicates no recursion, 1 is only one directory deep, and so on.
depth - the number of directories deep to recursepublic boolean isHidden(Path path)
Copyright © 2010 - 2020 Adobe. All Rights Reserved