Class RootUriTemplateHandler
java.lang.Object
org.springframework.boot.web.client.RootUriTemplateHandler
- All Implemented Interfaces:
org.springframework.web.util.UriTemplateHandler
public class RootUriTemplateHandler
extends Object
implements org.springframework.web.util.UriTemplateHandler
UriTemplateHandler to set the root for URI that starts with '/'.- Since:
- 1.4.0
-
Constructor Summary
ConstructorsModifierConstructorDescriptionRootUriTemplateHandler(String rootUri) Create a newRootUriTemplateHandlerinstance.RootUriTemplateHandler(String rootUri, org.springframework.web.util.UriTemplateHandler handler) Create a newRootUriTemplateHandlerinstance.protectedRootUriTemplateHandler(org.springframework.web.util.UriTemplateHandler handler) -
Method Summary
Modifier and TypeMethodDescriptionstatic RootUriTemplateHandlerAdd aRootUriTemplateHandlerinstance to the givenRestTemplate.withHandlerWrapper(Function<org.springframework.web.util.UriTemplateHandler, org.springframework.web.util.UriTemplateHandler> wrapper) Derives a newRootUriTemplateHandlerfrom this one, wrapping its delegateUriTemplateHandlerby applying the givenwrapper.
-
Constructor Details
-
RootUriTemplateHandler
protected RootUriTemplateHandler(org.springframework.web.util.UriTemplateHandler handler) -
RootUriTemplateHandler
Create a newRootUriTemplateHandlerinstance.- Parameters:
rootUri- the root URI to be used to prefix relative URLs
-
RootUriTemplateHandler
public RootUriTemplateHandler(String rootUri, org.springframework.web.util.UriTemplateHandler handler) Create a newRootUriTemplateHandlerinstance.- Parameters:
rootUri- the root URI to be used to prefix relative URLshandler- the delegate handler
-
-
Method Details
-
expand
- Specified by:
expandin interfaceorg.springframework.web.util.UriTemplateHandler
-
expand
- Specified by:
expandin interfaceorg.springframework.web.util.UriTemplateHandler
-
getRootUri
-
withHandlerWrapper
public RootUriTemplateHandler withHandlerWrapper(Function<org.springframework.web.util.UriTemplateHandler, org.springframework.web.util.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
public static RootUriTemplateHandler addTo(org.springframework.web.client.RestTemplate restTemplate, String rootUri) Add aRootUriTemplateHandlerinstance to the givenRestTemplate.- Parameters:
restTemplate- theRestTemplateto add the handler torootUri- the root URI- Returns:
- the added
RootUriTemplateHandler.
-