|
|
|
|
@ -138,6 +138,7 @@ public abstract class RouterFunctions {
@@ -138,6 +138,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param pattern the pattern to match |
|
|
|
|
* @param location the location directory relative to which resources should be resolved |
|
|
|
|
* @return a router function that routes to resources |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
* @see #resourceLookupFunction(String, Resource) |
|
|
|
|
*/ |
|
|
|
|
public static RouterFunction<ServerResponse> resources(String pattern, Resource location) { |
|
|
|
|
@ -156,6 +157,7 @@ public abstract class RouterFunctions {
@@ -156,6 +157,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param headersConsumer provides access to the HTTP headers for served resources |
|
|
|
|
* @return a router function that routes to resources |
|
|
|
|
* @since 6.1 |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
* @see #resourceLookupFunction(String, Resource) |
|
|
|
|
*/ |
|
|
|
|
public static RouterFunction<ServerResponse> resources(String pattern, Resource location, |
|
|
|
|
@ -177,6 +179,7 @@ public abstract class RouterFunctions {
@@ -177,6 +179,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param pattern the pattern to match |
|
|
|
|
* @param location the location directory relative to which resources should be resolved |
|
|
|
|
* @return the default resource lookup function for the given parameters. |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
public static Function<ServerRequest, Optional<Resource>> resourceLookupFunction(String pattern, Resource location) { |
|
|
|
|
return new PathResourceLookupFunction(pattern, location); |
|
|
|
|
@ -249,6 +252,7 @@ public abstract class RouterFunctions {
@@ -249,6 +252,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param handlerFunction the handler function to handle all {@code GET} requests that |
|
|
|
|
* match {@code pattern} |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder GET(String pattern, HandlerFunction<ServerResponse> handlerFunction); |
|
|
|
|
|
|
|
|
|
@ -280,6 +284,7 @@ public abstract class RouterFunctions {
@@ -280,6 +284,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param handlerFunction the handler function to handle all {@code GET} requests that |
|
|
|
|
* match {@code pattern} and the predicate |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
* @see RequestPredicates |
|
|
|
|
*/ |
|
|
|
|
Builder GET(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction); |
|
|
|
|
@ -299,6 +304,7 @@ public abstract class RouterFunctions {
@@ -299,6 +304,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param handlerFunction the handler function to handle all {@code HEAD} requests that |
|
|
|
|
* match {@code pattern} |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder HEAD(String pattern, HandlerFunction<ServerResponse> handlerFunction); |
|
|
|
|
|
|
|
|
|
@ -322,6 +328,7 @@ public abstract class RouterFunctions {
@@ -322,6 +328,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param handlerFunction the handler function to handle all {@code HEAD} requests that |
|
|
|
|
* match {@code pattern} |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder HEAD(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction); |
|
|
|
|
|
|
|
|
|
@ -340,6 +347,7 @@ public abstract class RouterFunctions {
@@ -340,6 +347,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param handlerFunction the handler function to handle all {@code POST} requests that |
|
|
|
|
* match {@code pattern} |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder POST(String pattern, HandlerFunction<ServerResponse> handlerFunction); |
|
|
|
|
|
|
|
|
|
@ -371,6 +379,7 @@ public abstract class RouterFunctions {
@@ -371,6 +379,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param handlerFunction the handler function to handle all {@code POST} requests that |
|
|
|
|
* match {@code pattern} |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder POST(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction); |
|
|
|
|
|
|
|
|
|
@ -389,6 +398,7 @@ public abstract class RouterFunctions {
@@ -389,6 +398,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param handlerFunction the handler function to handle all {@code PUT} requests that |
|
|
|
|
* match {@code pattern} |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder PUT(String pattern, HandlerFunction<ServerResponse> handlerFunction); |
|
|
|
|
|
|
|
|
|
@ -420,6 +430,7 @@ public abstract class RouterFunctions {
@@ -420,6 +430,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param handlerFunction the handler function to handle all {@code PUT} requests that |
|
|
|
|
* match {@code pattern} |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder PUT(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction); |
|
|
|
|
|
|
|
|
|
@ -438,6 +449,7 @@ public abstract class RouterFunctions {
@@ -438,6 +449,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param handlerFunction the handler function to handle all {@code PATCH} requests that |
|
|
|
|
* match {@code pattern} |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder PATCH(String pattern, HandlerFunction<ServerResponse> handlerFunction); |
|
|
|
|
|
|
|
|
|
@ -469,6 +481,7 @@ public abstract class RouterFunctions {
@@ -469,6 +481,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param handlerFunction the handler function to handle all {@code PATCH} requests that |
|
|
|
|
* match {@code pattern} |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder PATCH(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction); |
|
|
|
|
|
|
|
|
|
@ -487,6 +500,7 @@ public abstract class RouterFunctions {
@@ -487,6 +500,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param handlerFunction the handler function to handle all {@code DELETE} requests that |
|
|
|
|
* match {@code pattern} |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder DELETE(String pattern, HandlerFunction<ServerResponse> handlerFunction); |
|
|
|
|
|
|
|
|
|
@ -510,6 +524,7 @@ public abstract class RouterFunctions {
@@ -510,6 +524,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param handlerFunction the handler function to handle all {@code DELETE} requests that |
|
|
|
|
* match {@code pattern} |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder DELETE(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction); |
|
|
|
|
|
|
|
|
|
@ -528,6 +543,7 @@ public abstract class RouterFunctions {
@@ -528,6 +543,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param handlerFunction the handler function to handle all {@code OPTIONS} requests that |
|
|
|
|
* match {@code pattern} |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder OPTIONS(String pattern, HandlerFunction<ServerResponse> handlerFunction); |
|
|
|
|
|
|
|
|
|
@ -551,6 +567,7 @@ public abstract class RouterFunctions {
@@ -551,6 +567,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param handlerFunction the handler function to handle all {@code OPTIONS} requests that |
|
|
|
|
* match {@code pattern} |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder OPTIONS(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction); |
|
|
|
|
|
|
|
|
|
@ -595,6 +612,7 @@ public abstract class RouterFunctions {
@@ -595,6 +612,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param pattern the pattern to match |
|
|
|
|
* @param location the location directory relative to which resources should be resolved |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder resources(String pattern, Resource location); |
|
|
|
|
|
|
|
|
|
@ -610,6 +628,7 @@ public abstract class RouterFunctions {
@@ -610,6 +628,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param headersConsumer provides access to the HTTP headers for served resources |
|
|
|
|
* @return this builder |
|
|
|
|
* @since 6.1 |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder resources(String pattern, Resource location, BiConsumer<Resource, HttpHeaders> headersConsumer); |
|
|
|
|
|
|
|
|
|
@ -700,6 +719,7 @@ public abstract class RouterFunctions {
@@ -700,6 +719,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param routerFunctionSupplier supplier for the nested router function to delegate to if |
|
|
|
|
* the pattern matches |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder path(String pattern, Supplier<RouterFunction<ServerResponse>> routerFunctionSupplier); |
|
|
|
|
|
|
|
|
|
@ -722,6 +742,7 @@ public abstract class RouterFunctions {
@@ -722,6 +742,7 @@ public abstract class RouterFunctions {
|
|
|
|
|
* @param builderConsumer consumer for a {@code Builder} that provides the nested router |
|
|
|
|
* function |
|
|
|
|
* @return this builder |
|
|
|
|
* @see org.springframework.web.util.pattern.PathPattern |
|
|
|
|
*/ |
|
|
|
|
Builder path(String pattern, Consumer<Builder> builderConsumer); |
|
|
|
|
|
|
|
|
|
|