Package dk.mada.jaxrs.generator.mpclient
Class CommonPathFinder
java.lang.Object
dk.mada.jaxrs.generator.mpclient.CommonPathFinder
REST common path finder.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindCommonPath
(List<String> paths) Find longest common sub-path of the paths provided.
-
Constructor Details
-
CommonPathFinder
public CommonPathFinder()
-
-
Method Details
-
findCommonPath
Find longest common sub-path of the paths provided. First find shortest path, use that as base. From this, build all potential common prefixes, by cutting path elements of. Then simply search this list (which is longest to shortest) for prefixes that matches all paths.- Parameters:
paths
- the paths to look through- Returns:
- the longest common path
-