Package uk.num.numlib.internal.util
Class UrlRelativePathResolver
java.lang.Object
uk.num.numlib.internal.util.UrlRelativePathResolver
public final class UrlRelativePathResolver
extends java.lang.Object
Convert a path of the form `/a/b/c/../../d/../e/../..` etc to a resolved path.
-
Constructor Summary
Constructors Constructor Description UrlRelativePathResolver() -
Method Summary
Modifier and Type Method Description static java.lang.Stringresolve(java.lang.String base, java.lang.String redirect)Convert a path of the form `/a/b/c/../../d/../e/../..` etc to a resolved path.
-
Constructor Details
-
UrlRelativePathResolver
public UrlRelativePathResolver()
-
-
Method Details
-
resolve
public static java.lang.String resolve(java.lang.String base, java.lang.String redirect) throws RelativePathExceptionConvert a path of the form `/a/b/c/../../d/../e/../..` etc to a resolved path.- Parameters:
base- the base path that we're moving relative toredirect- the relative path - can include `../` sections- Returns:
- the resolved path
- Throws:
RelativePathException- when the redirect is beyond the root of the base path
-