Class RootUriTemplateHandler
java.lang.Object
org.springframework.boot.web.client.RootUriTemplateHandler
- All Implemented Interfaces:
UriTemplateHandler
- Direct Known Subclasses:
LocalHostUriTemplateHandler
UriTemplateHandler
to set the root for URI that starts with '/'
.- Since:
- 1.4.0
- Author:
- Phillip Webb
-
Constructor Summary
ModifierConstructorDescriptionRootUriTemplateHandler
(String rootUri) Create a newRootUriTemplateHandler
instance.RootUriTemplateHandler
(String rootUri, UriTemplateHandler handler) Create a newRootUriTemplateHandler
instance.protected
RootUriTemplateHandler
(UriTemplateHandler handler) -
Method Summary
Modifier and TypeMethodDescriptionstatic RootUriTemplateHandler
addTo
(RestTemplate restTemplate, String rootUri) Add aRootUriTemplateHandler
instance to the givenRestTemplate
.Derives a newRootUriTemplateHandler
from this one, wrapping its delegateUriTemplateHandler
by applying the givenwrapper
.
-
Constructor Details
-
RootUriTemplateHandler
-
RootUriTemplateHandler
Create a newRootUriTemplateHandler
instance.- Parameters:
rootUri
- the root URI to be used to prefix relative URLs
-
RootUriTemplateHandler
Create a newRootUriTemplateHandler
instance.- Parameters:
rootUri
- the root URI to be used to prefix relative URLshandler
- the delegate handler
-
-
Method Details
-
expand
- Specified by:
expand
in interfaceUriTemplateHandler
-
expand
- Specified by:
expand
in interfaceUriTemplateHandler
-
getRootUri
-
withHandlerWrapper
public RootUriTemplateHandler withHandlerWrapper(Function<UriTemplateHandler, UriTemplateHandler> wrapper) Derives a newRootUriTemplateHandler
from this one, wrapping its delegateUriTemplateHandler
by applying the givenwrapper
.- Parameters:
wrapper
- the wrapper to apply to the delegate URI template handler- Returns:
- the new handler
- Since:
- 2.3.10
-
addTo
Add aRootUriTemplateHandler
instance to the givenRestTemplate
.- Parameters:
restTemplate
- theRestTemplate
to add the handler torootUri
- the root URI- Returns:
- the added
RootUriTemplateHandler
.
-