Package org.eclipse.jetty.util
Class PathWatcher.Config
java.lang.Object
org.eclipse.jetty.util.PathWatcher.Config
- Enclosing class:
PathWatcher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected final IncludeExcludeSet
<PathMatcher, Path> protected final PathWatcher.Config
protected final Path
private static final String
protected long
protected int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExclude
(String syntaxAndPattern) Add an exclude PathMatcher.void
addExclude
(PathMatcher matcher) Add an exclude PathMatchervoid
addExcludeGlobRelative
(String pattern) Add aglob:
syntax pattern exclude reference in a directory relative, os neutral, pattern.void
Exclude hidden files and hidden directoriesvoid
addExcludes
(List<String> syntaxAndPatterns) Add multiple exclude PathMatchersvoid
addInclude
(String syntaxAndPattern) Add an include PathMatchervoid
addInclude
(PathMatcher matcher) Add an include PathMatchervoid
addIncludeGlobRelative
(String pattern) Add aglob:
syntax pattern reference in a directory relative, os neutral, pattern.void
addIncludes
(List<String> syntaxAndPatterns) Add multiple include PathMatchersasSubConfig
(Path dir) Build a new config from a this configuration.getPath()
int
(package private) PathWatcher.DirAction
boolean
boolean
isPaused
(long now) boolean
void
setPauseUntil
(long time) void
setRecurseDepth
(int depth) Set the recurse depth for the directory scanning.boolean
private String
toGlobPattern
(Path path, String subPattern) toShortPath
(Path path) toString()
-
Field Details
-
UNLIMITED_DEPTH
public static final int UNLIMITED_DEPTH- See Also:
-
PATTERN_SEP
-
parent
-
path
-
includeExclude
-
recurseDepth
protected int recurseDepth -
excludeHidden
protected boolean excludeHidden -
pauseUntil
protected long pauseUntil
-
-
Constructor Details
-
Config
-
Config
-
-
Method Details
-
getParent
-
setPauseUntil
public void setPauseUntil(long time) -
isPaused
public boolean isPaused(long now) -
addExclude
Add an exclude PathMatcher- Parameters:
matcher
- the path matcher for this exclude
-
addExclude
Add an exclude PathMatcher.Note: this pattern is FileSystem specific (so use "/" for Linux and OSX, and "\\" for Windows)
- Parameters:
syntaxAndPattern
- the PathMatcher syntax and pattern to use- See Also:
-
addExcludeGlobRelative
Add aglob:
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"
- Parameters:
pattern
- the pattern, in unixy format, relative to config.dir
-
addExcludeHidden
public void addExcludeHidden()Exclude hidden files and hidden directories -
addExcludes
Add multiple exclude PathMatchers- Parameters:
syntaxAndPatterns
- the list of PathMatcher syntax and patterns to use- See Also:
-
addInclude
Add an include PathMatcher- Parameters:
matcher
- the path matcher for this include
-
addInclude
Add an include PathMatcher- Parameters:
syntaxAndPattern
- the PathMatcher syntax and pattern to use- See Also:
-
addIncludeGlobRelative
Add aglob:
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"
- Parameters:
pattern
- the pattern, in unixy format, relative to config.dir
-
addIncludes
Add multiple include PathMatchers- Parameters:
syntaxAndPatterns
- the list of PathMatcher syntax and patterns to use- See Also:
-
asSubConfig
Build a new config from a this configuration.Useful for working with sub-directories that also need to be watched.
- Parameters:
dir
- the directory to build new Config from (using this config as source of includes/excludes)- Returns:
- the new Config
-
getRecurseDepth
public int getRecurseDepth() -
isRecurseDepthUnlimited
public boolean isRecurseDepthUnlimited() -
getPath
-
resolve
-
test
-
setRecurseDepth
public void setRecurseDepth(int depth) Set the recurse depth for the directory scanning.-999 indicates arbitrarily deep recursion, 0 indicates no recursion, 1 is only one directory deep, and so on.
- Parameters:
depth
- the number of directories deep to recurse
-
toGlobPattern
-
handleDir
-
isHidden
-
toShortPath
-
toString
-