public class DefaultPathMapper extends Object implements Serializable, PathMapper
Modified to store a list of keys for a mapping rather than a single value. This allows filters to be added that listen on the same path. The get() method will return the first value added if there are multiple keys matching the path, while the getAll() method returns the aggregate matches.
In practice, matching a servlet path should use the get() method and matching filters should use the getAll() method.
| Constructor and Description |
|---|
DefaultPathMapper() |
| Modifier and Type | Method and Description |
|---|---|
String |
get(String path)
Retrieve appropriate key by matching patterns with supplied path.
|
Collection<String> |
getAll(String path)
Retrieve all mappings which match a supplied path.
|
void |
put(String key,
String pattern)
Add a key and appropriate matching pattern.
|
protected String |
removeRedundantSlashes(String path)
Reduces sequences of more than one consecutive forward slash ("/") to a
single slash (see: https://studio.atlassian.com/browse/PLUG-597).
|
String |
toString() |
public void put(String key, String pattern)
PathMapperput in interface PathMapperpublic String get(String path)
PathMapperget in interface PathMapperpublic Collection<String> getAll(String path)
PathMappergetAll in interface PathMapperprotected String removeRedundantSlashes(String path)
path - any string, including null (e.g. "foo//bar")"foo/bar")Copyright © 2019 Atlassian. All rights reserved.