public class PathPatternMatcher extends Object
In addition, a path separator at the end of a
strings serves as a convenience shortcut so
that "string/" behaves like "string/**".
NOTE that PathPatternMatcher
does reject some strings that the open source
tools accepts. E.g., the ant
manual pages state that the following two pairs
of string and pattern do match.
PathPatternMatcher rejects
those examples; the first one
because the pattern contains
2 terminal symbols of type
path separator while the
string contains only 1; the
second examples is rejected
for almost the same reason:
the pattern contains 2 path
separators between the
"apache" and the "CVS" part
of the pattern while the
string has only 1.
Copyright (c) SAP AG
2001-2002
Copyright 2018 SAP AG Complete Copyright Notice
1. path separators '/' and '\'
either slash or backslash
2. single character wildcard '?'
question mark; matches any single non-whitespace char except
for path separators
3. multiple character wildcard '*'
asterisk, matches sequences of non-whitespace characters
of any length greater or equal zero
4. multiple dir wildcard '**'
matches any sequences of groups of nodes and path
separators
5. node
any sequence of non-whitespace characters not
including separators
String
Pattern
"CVS/Repository"
"**/CVS/*"
"org/apache/CVS/Entries"
"org/apache/**/CVS/*"
Constructor Summary
Constructor and Description
PathPatternMatcher(String pattern)
pattern
.
PathPatternMatcher(String[] pattern)
pattern
.
Method Summary
Modifier and Type
Method and Description
boolean
matches(String needle)
needle
against the pattern of this pattern matcher.
String
toString()
Constructor Detail
PathPatternMatcher
public PathPatternMatcher(String pattern)
throws PatternSyntaxException
pattern
.
pattern
- TBD: Description of the incoming method parameterPatternSyntaxException
- Exception raised in failure situation
PathPatternMatcher
public PathPatternMatcher(String[] pattern)
throws PatternSyntaxException
pattern
.
pattern
- TBD: Description of the incoming method parameterPatternSyntaxException
- Exception raised in failure situation
Method Detail
matches
public boolean matches(String needle)
needle
against the pattern of this pattern matcher.
needle
- TBD: Description of the incoming method parameter
Access Rights
This class can be accessed from:
SC
DC
Public Part
ACH
[sap.com] KMC-CM
[sap.com] tc/km/frwk
api
EP-KM-CM
[sap.com] KMC-WPC
[sap.com] tc/kmc/wpc/wpcfacade
api
EP-PIN-WPC-WCM