public class HttpRequestPathHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
urlDecode |
Constructor and Description |
---|
HttpRequestPathHelper() |
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
decode(ServerWebExchange exchange,
java.lang.String path) |
MultiValueMap<java.lang.String,java.lang.String> |
decodeMatrixVariables(ServerWebExchange exchange,
MultiValueMap<java.lang.String,java.lang.String> vars)
Decode the given matrix variables unless
setUrlDecode(boolean)
is set to true in which case it is assumed the URL path from
which the variables were extracted is already decoded through a call to
getLookupPathForRequest(ServerWebExchange) . |
java.util.Map<java.lang.String,java.lang.String> |
decodePathVariables(ServerWebExchange exchange,
java.util.Map<java.lang.String,java.lang.String> vars)
Decode the given URI path variables unless
setUrlDecode(boolean)
is set to true in which case it is assumed the URL path from
which the variables were extracted is already decoded through a call to
getLookupPathForRequest(ServerWebExchange) . |
java.lang.String |
getLookupPathForRequest(ServerWebExchange exchange) |
private java.lang.String |
getPathWithinApplication(ServerHttpRequest request) |
void |
setUrlDecode(boolean urlDecode)
Set if the request path should be URL-decoded.
|
boolean |
shouldUrlDecode()
Whether the request path should be URL decoded.
|
public void setUrlDecode(boolean urlDecode)
Default is "true".
UriUtils.decode(String, String)
public boolean shouldUrlDecode()
public java.lang.String getLookupPathForRequest(ServerWebExchange exchange)
private java.lang.String getPathWithinApplication(ServerHttpRequest request)
private java.lang.String decode(ServerWebExchange exchange, java.lang.String path)
public java.util.Map<java.lang.String,java.lang.String> decodePathVariables(ServerWebExchange exchange, java.util.Map<java.lang.String,java.lang.String> vars)
setUrlDecode(boolean)
is set to true
in which case it is assumed the URL path from
which the variables were extracted is already decoded through a call to
getLookupPathForRequest(ServerWebExchange)
.exchange
- current exchangevars
- URI variables extracted from the URL pathpublic MultiValueMap<java.lang.String,java.lang.String> decodeMatrixVariables(ServerWebExchange exchange, MultiValueMap<java.lang.String,java.lang.String> vars)
setUrlDecode(boolean)
is set to true
in which case it is assumed the URL path from
which the variables were extracted is already decoded through a call to
getLookupPathForRequest(ServerWebExchange)
.exchange
- current exchangevars
- URI variables extracted from the URL path