Package org.apache.juneau.rest.mock
Class MockPathResolver
java.lang.Object
org.apache.juneau.rest.mock.MockPathResolver
Used to resolve incoming URLS to the various URL artifacts of HttpServletRequest .
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the context path of the URL.getError()Returns any parsing errors.Returns the remainder of the URL following the context and servlet paths.Returns the servlet path of the URL.Returns just the hostname portion of the URL.getURI()Returns the fully-qualified URL.toString()
-
Constructor Details
-
MockPathResolver
public MockPathResolver(String target, String contextPath, String servletPath, String pathToResolve, Map<String, Object> pathVars) Constructor.- Parameters:
target- The target portion of the URL (e.g."http://localhost" ).
Ifnull ,"http://localhost" is assumed.contextPath- The context path of the servlet, ornull if unknown or doesn't have one.servletPath- The servlet path of the servlet, ornull if unknown or doesn't have one.pathToResolve- The path to resolve.
Can be relative to servlet or an absolute path.pathVars- Optional path variables to resolve in the context path or servlet path.
-
-
Method Details
-
getContextPath
Returns the context path of the URL.- Returns:
- The context path of the URL always starting with
'/' , or an empty string if it doesn't exist.
-
getError
Returns any parsing errors.- Returns:
- Any parsing errors, or
null if parsing was successful.
-
getRemainder
Returns the remainder of the URL following the context and servlet paths.- Returns:
- The remainder of the URL.
-
getServletPath
Returns the servlet path of the URL.- Returns:
- The servlet path of the URL always starting with
'/' , or an empty string if it doesn't exist.
-
getTarget
Returns just the hostname portion of the URL.- Returns:
- The hostname portion of the URL.
-
getURI
Returns the fully-qualified URL.- Returns:
- The fully-qualified URL.
-
properties
-
toString
-