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
ConstructorsModifierConstructorDescriptionRootUriTemplateHandler(String rootUri) Create a newRootUriTemplateHandlerinstance.RootUriTemplateHandler(String rootUri, UriTemplateHandler handler) Create a newRootUriTemplateHandlerinstance.protectedRootUriTemplateHandler(UriTemplateHandler handler) -
Method Summary
Modifier and TypeMethodDescriptionstatic RootUriTemplateHandleraddTo(RestTemplate restTemplate, String rootUri) Add aRootUriTemplateHandlerinstance to the givenRestTemplate.Derives a newRootUriTemplateHandlerfrom this one, wrapping its delegateUriTemplateHandlerby applying the givenwrapper.
-
Constructor Details
-
RootUriTemplateHandler
-
RootUriTemplateHandler
Create a newRootUriTemplateHandlerinstance.- Parameters:
rootUri- the root URI to be used to prefix relative URLs
-
RootUriTemplateHandler
Create a newRootUriTemplateHandlerinstance.- Parameters:
rootUri- the root URI to be used to prefix relative URLshandler- the delegate handler
-
-
Method Details
-
expand
- Specified by:
expandin interfaceUriTemplateHandler
-
expand
- Specified by:
expandin interfaceUriTemplateHandler
-
getRootUri
-
withHandlerWrapper
public RootUriTemplateHandler withHandlerWrapper(Function<UriTemplateHandler, UriTemplateHandler> wrapper) Derives a newRootUriTemplateHandlerfrom this one, wrapping its delegateUriTemplateHandlerby 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 aRootUriTemplateHandlerinstance to the givenRestTemplate.- Parameters:
restTemplate- theRestTemplateto add the handler torootUri- the root URI- Returns:
- the added
RootUriTemplateHandler.
-