Class DefaultPathMapper
java.lang.Object
com.atlassian.plugin.servlet.util.DefaultPathMapper
- All Implemented Interfaces:
PathMapper,Serializable
Originally copied from Atlassian Seraph 1.0
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.
- Since:
- 2.1.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieve appropriate key by matching patterns with supplied path.Retrieve all mappings which match a supplied path.voidAdd a key and appropriate matching pattern.protected StringremoveRedundantSlashes(String path) Reduces sequences of more than one consecutive forward slash ("/") to a single slash (see: https://studio.atlassian.com/browse/PLUG-597).toString()
-
Constructor Details
-
DefaultPathMapper
public DefaultPathMapper()
-
-
Method Details
-
put
Description copied from interface:PathMapperAdd a key and appropriate matching pattern.- Specified by:
putin interfacePathMapper
-
get
Description copied from interface:PathMapperRetrieve appropriate key by matching patterns with supplied path.- Specified by:
getin interfacePathMapper
-
getAll
Description copied from interface:PathMapperRetrieve all mappings which match a supplied path.- Specified by:
getAllin interfacePathMapper
-
removeRedundantSlashes
Reduces sequences of more than one consecutive forward slash ("/") to a single slash (see: https://studio.atlassian.com/browse/PLUG-597).- Parameters:
path- any string, includingnull(e.g."foo//bar")- Returns:
- the input string, with all sequences of more than one
consecutive slash removed (e.g.
"foo/bar")
-
toString
-