PathMatcher.extractPathWithinPattern

Given a pattern and a full path, determine the pattern-mapped part. <p>This method is supposed to find out which part of the path is matched dynamically through an actual pattern, that is, it strips off a statically defined leading path from the given full path, returning only the actually pattern-matched part of the path. <p>For example: For "myroot/*.html" as pattern and "myroot/myfile.html" as full path, this method should return "myfile.html". The detailed determination rules are specified to this PathMatcher's matching strategy. <p>A simple implementation may return the given full path as-is in case of an actual pattern, and the empty string in case of the pattern not containing any dynamic parts (i.e. the {@code pattern} parameter being a static path that wouldn't qualify as an actual {@link #isPattern pattern}). A sophisticated implementation will differentiate between the static parts and the dynamic parts of the given path pattern. @param pattern the path pattern @param path the full path to introspect @return the pattern-mapped part of the given {@code path} (never {@code null})

interface PathMatcher
string
extractPathWithinPattern
(
string pattern
,
string path
)

Meta