List of usage examples for org.springframework.web.reactive.function.server PathResourceLookupFunction PathResourceLookupFunction
public PathResourceLookupFunction(String pattern, Resource location)
From source file:org.springframework.web.reactive.function.server.RouterFunctions.java
/** * Route requests that match the given pattern to resources relative to the given root location. * For instance/*from ww w. j a v a 2s. c o m*/ * <pre class="code"> * Resource location = new FileSystemResource("public-resources/"); * RoutingFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location); * </pre> * @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 */ public static RouterFunction<ServerResponse> resources(String pattern, Resource location) { Assert.hasLength(pattern, "'pattern' must not be empty"); Assert.notNull(location, "'location' must not be null"); return resources(new PathResourceLookupFunction(pattern, location)); }