Use PathContainer in web.reactive.function.server

This commit uses the newly introduced `PathContainer` and `RequestPath`
support in the functional web framework. It exposes the path container
as property in `ServerRequest`, and uses that in the path-based
`RequestPredicates`.
This commit is contained in:
Arjen Poutsma
2017-07-03 12:33:41 +02:00
parent 727ca4514a
commit 2ccbc55ffd
9 changed files with 191 additions and 75 deletions

View File

@@ -15,6 +15,9 @@
*/
package org.springframework.http.server.reactive;
import java.net.URI;
import java.nio.charset.Charset;
/**
* Represents the complete path for a request.
*
@@ -38,4 +41,11 @@ public interface RequestPath extends PathContainer {
*/
PathContainer pathWithinApplication();
/**
* Create a new {@code RequestPath} with the given parameters.
*/
static RequestPath create(URI uri, String contextPath, Charset charset) {
return new DefaultRequestPath(uri, contextPath, charset);
}
}

View File

@@ -539,8 +539,8 @@ public class PathPattern implements Comparable<PathPattern> {
/**
* Return the part of a path that was not matched by a pattern.
*/
public String getPathRemaining() {
return this.pathRemaining.value();
public PathContainer getPathRemaining() {
return this.pathRemaining;
}
/**