Introduce method to allow a pattern to partially consume a path
With this change there is a new getPathRemaining() method on
PathPattern objects. It is called with a path and returns
the path remaining once the path pattern in question has
matched as much as it can of that path. For example if the
pattern is /fo* and the path is /foo/bar then getPathRemaining
will return /bar. This allows for a set of pathpatterns
to work together in sequence to match a complete entire path.
Issue: SPR-15336
@ -147,6 +147,42 @@ public class PathPattern implements Comparable<PathPattern> {
@@ -147,6 +147,42 @@ public class PathPattern implements Comparable<PathPattern> {
@ -384,7 +420,14 @@ public class PathPattern implements Comparable<PathPattern> {
@@ -384,7 +420,14 @@ public class PathPattern implements Comparable<PathPattern> {
privateMap<String,String>extractedVariables;
publicbooleanextractingVariables;
booleanextractingVariables;
booleandetermineRemaining=false;
// if determineRemaining is true, this is set to the position in
// the candidate where the pattern finished matching - i.e. it
// points to the remaining path that wasn't consumed
@ -392,6 +435,13 @@ public class PathPattern implements Comparable<PathPattern> {
@@ -392,6 +435,13 @@ public class PathPattern implements Comparable<PathPattern> {