|
org.netbeans.modules.project.ant/1 1.16 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.spi.project.support.ant.PathMatcher
public final class PathMatcher
Utility to match Ant-style file patterns with extended glob syntax.
A path matcher can be given an optional list of include patterns, and an optional list of exclude patterns. A given file path matches the pattern if it is matched by at least one include pattern (or there is a null includes list), and is not matched by any of the exclude patterns (if this list is not null).
The format is based on Ant patterns. Some details:
Some example patterns:
Constructor Summary | |
---|---|
PathMatcher(String includes,
String excludes,
File base)
Create a path matching object. |
Method Summary | |
---|---|
Set<File> |
findIncludedRoots()
Find folders which match although their parent folders do not; or folders which do not match but which contain files which do. |
boolean |
matches(String path,
boolean useKnownIncludes)
Check whether a given path matches some includes (if not null) and no excludes. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PathMatcher(String includes, String excludes, File base)
matches(java.lang.String, boolean)
multiple times
than to recreate a matcher for each query.
includes
- a list of paths to match, or null to match everything by defaultexcludes
- a list of paths to not match, or nullbase
- a base directory to scan for known include roots (see findIncludedRoots()
), or null if unknownMethod Detail |
---|
public boolean matches(String path, boolean useKnownIncludes)
path
- a relative file path as described in class JavadocuseKnownIncludes
- true to also match in case this path is a parent of some known included root
public Set<File> findIncludedRoots() throws IllegalArgumentException
match
are noted, and their minimal paths are returned.
IllegalArgumentException
public String toString()
|
org.netbeans.modules.project.ant/1 1.16 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |