/** * A method for parsing of the query into name-value pairs. The return * value is turned into an immutable map and cached. * <p>Note that this method is invoked lazily on first access to * {@link #getQueryParams()}. The invocation is not synchronized but the * parsing is thread-safe nevertheless. */ protected MultiValueMap<String, String> initQueryParams() { MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<>(); String query = getURI().getRawQuery(); if (query != null) { Matcher matcher = QUERY_PATTERN.matcher(query); while (matcher.find()) { String name = decodeQueryParam(matcher.group(1)); String eq = matcher.group(2); String value = matcher.group(3); value = (value != null ? decodeQueryParam(value) : (StringUtils.hasLength(eq) ? "" : null)); queryParams.add(name, value); } } return queryParams; }
/** * For internal use in logging at the HTTP adapter layer. * @since 5.1 */ String getLogPrefix() { if (this.logPrefix == null) { this.logPrefix = "[" + getId() + "] "; } return this.logPrefix; }
@SuppressWarnings("deprecation") private String decodeQueryParam(String value) { try { return URLDecoder.decode(value, "UTF-8"); } catch (UnsupportedEncodingException ex) { if (logger.isWarnEnabled()) { logger.warn(getLogPrefix() + "Could not decode query value [" + value + "] as 'UTF-8'. " + "Falling back on default encoding: " + ex.getMessage()); } return URLDecoder.decode(value); } }
@Nullable @Override public SslInfo getSslInfo() { if (this.sslInfo == null) { this.sslInfo = initSslInfo(); } return this.sslInfo; }
@Override public MultiValueMap<String, String> getQueryParams() { if (this.queryParams == null) { this.queryParams = CollectionUtils.unmodifiableMultiValueMap(initQueryParams()); } return this.queryParams; }
@Override public MultiValueMap<String, HttpCookie> getCookies() { if (this.cookies == null) { this.cookies = CollectionUtils.unmodifiableMultiValueMap(initCookies()); } return this.cookies; }
public String getId() { if (this.id == null) { this.id = initId(); if (this.id == null) { this.id = ObjectUtils.getIdentityHexString(this); } } return this.id; }
/** * A method for parsing of the query into name-value pairs. The return * value is turned into an immutable map and cached. * <p>Note that this method is invoked lazily on first access to * {@link #getQueryParams()}. The invocation is not synchronized but the * parsing is thread-safe nevertheless. */ protected MultiValueMap<String, String> initQueryParams() { MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<>(); String query = getURI().getRawQuery(); if (query != null) { Matcher matcher = QUERY_PATTERN.matcher(query); while (matcher.find()) { String name = decodeQueryParam(matcher.group(1)); String eq = matcher.group(2); String value = matcher.group(3); value = (value != null ? decodeQueryParam(value) : (StringUtils.hasLength(eq) ? "" : null)); queryParams.add(name, value); } } return queryParams; }
private HttpServletRequest getHttpServletRequest(ServerHttpRequest request) { Assert.isInstanceOf(AbstractServerHttpRequest.class, request, "ServletServerHttpRequest required"); return ((AbstractServerHttpRequest) request).getNativeRequest(); }
@Nullable @Override public SslInfo getSslInfo() { if (this.sslInfo == null) { this.sslInfo = initSslInfo(); } return this.sslInfo; }
@Override public MultiValueMap<String, String> getQueryParams() { if (this.queryParams == null) { this.queryParams = CollectionUtils.unmodifiableMultiValueMap(initQueryParams()); } return this.queryParams; }
@Override public MultiValueMap<String, HttpCookie> getCookies() { if (this.cookies == null) { this.cookies = CollectionUtils.unmodifiableMultiValueMap(initCookies()); } return this.cookies; }
public String getId() { if (this.id == null) { this.id = initId(); if (this.id == null) { this.id = ObjectUtils.getIdentityHexString(this); } } return this.id; }
private HttpServletRequest getHttpServletRequest(ServerHttpRequest request) { Assert.isInstanceOf(AbstractServerHttpRequest.class, request); return ((AbstractServerHttpRequest) request).getNativeRequest(); }
/** * A method for parsing of the query into name-value pairs. The return * value is turned into an immutable map and cached. * <p>Note that this method is invoked lazily on first access to * {@link #getQueryParams()}. The invocation is not synchronized but the * parsing is thread-safe nevertheless. */ protected MultiValueMap<String, String> initQueryParams() { MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<>(); String query = getURI().getRawQuery(); if (query != null) { Matcher matcher = QUERY_PATTERN.matcher(query); while (matcher.find()) { String name = decodeQueryParam(matcher.group(1)); String eq = matcher.group(2); String value = matcher.group(3); value = (value != null ? decodeQueryParam(value) : (StringUtils.hasLength(eq) ? "" : null)); queryParams.add(name, value); } } return queryParams; }
@Nullable @Override public SslInfo getSslInfo() { if (this.sslInfo == null) { this.sslInfo = initSslInfo(); } return this.sslInfo; }
@Override public MultiValueMap<String, String> getQueryParams() { if (this.queryParams == null) { this.queryParams = CollectionUtils.unmodifiableMultiValueMap(initQueryParams()); } return this.queryParams; }
@Override public MultiValueMap<String, HttpCookie> getCookies() { if (this.cookies == null) { this.cookies = CollectionUtils.unmodifiableMultiValueMap(initCookies()); } return this.cookies; }
public String getId() { if (this.id == null) { this.id = initId(); if (this.id == null) { this.id = ObjectUtils.getIdentityHexString(this); } } return this.id; }
/** * For internal use in logging at the HTTP adapter layer. * @since 5.1 */ String getLogPrefix() { if (this.logPrefix == null) { this.logPrefix = "[" + getId() + "] "; } return this.logPrefix; }