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
Constructors Modifier Constructor Description RootUriTemplateHandler(String rootUri)
Create a newRootUriTemplateHandler
instance.RootUriTemplateHandler(String rootUri, org.springframework.web.util.UriTemplateHandler handler)
Create a newRootUriTemplateHandler
instance.protected
RootUriTemplateHandler(org.springframework.web.util.UriTemplateHandler handler)
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RootUriTemplateHandler
addTo(org.springframework.web.client.RestTemplate restTemplate, String rootUri)
Add aRootUriTemplateHandler
instance to the givenRestTemplate
.URI
expand(String uriTemplate, Object... uriVariables)
URI
expand(String uriTemplate, Map<String,?> uriVariables)
String
getRootUri()
Constructor Detail
RootUriTemplateHandler
protected RootUriTemplateHandler(org.springframework.web.util.UriTemplateHandler handler)
RootUriTemplateHandler
public RootUriTemplateHandler(String rootUri)
Create a newRootUriTemplateHandler
instance.- 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 newRootUriTemplateHandler
instance.- Parameters:
rootUri
- the root URI to be used to prefix relative URLshandler
- the delegate handler
Method Detail
expand
public URI expand(String uriTemplate, Map<String,?> uriVariables)
- Specified by:
expand
in interfaceorg.springframework.web.util.UriTemplateHandler
expand
public URI expand(String uriTemplate, Object... uriVariables)
- Specified by:
expand
in interfaceorg.springframework.web.util.UriTemplateHandler
getRootUri
public String getRootUri()
addTo
public static RootUriTemplateHandler addTo(org.springframework.web.client.RestTemplate restTemplate, String rootUri)
Add aRootUriTemplateHandler
instance to the givenRestTemplate
.- Parameters:
restTemplate
- theRestTemplate
to add the handler torootUri
- the root URI- Returns:
- the added
RootUriTemplateHandler
.