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:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user