From f0f3df5cc05be50335498fece59fbfc53fe825f7 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Wed, 10 May 2017 10:12:55 +0200 Subject: [PATCH] Use PathPattern in PathResourceLookupFunction --- .../server/PathResourceLookupFunction.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/PathResourceLookupFunction.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/PathResourceLookupFunction.java index 1a00f8e88d..12fd6e9b6a 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/PathResourceLookupFunction.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/PathResourceLookupFunction.java @@ -26,10 +26,10 @@ import reactor.core.publisher.Mono; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.core.io.UrlResource; -import org.springframework.util.AntPathMatcher; -import org.springframework.util.PathMatcher; import org.springframework.util.ResourceUtils; import org.springframework.util.StringUtils; +import org.springframework.web.util.patterns.PathPattern; +import org.springframework.web.util.patterns.PathPatternParser; /** * Lookup function used by {@link RouterFunctions#resources(String, Resource)}. @@ -39,15 +39,15 @@ import org.springframework.util.StringUtils; */ class PathResourceLookupFunction implements Function> { - private static final PathMatcher PATH_MATCHER = new AntPathMatcher(); + private static final PathPatternParser PATTERN_PARSER = new PathPatternParser(); - private final String pattern; + private final PathPattern pattern; private final Resource location; public PathResourceLookupFunction(String pattern, Resource location) { - this.pattern = pattern; + this.pattern = PATTERN_PARSER.parse(pattern); this.location = location; } @@ -61,11 +61,11 @@ class PathResourceLookupFunction implements Function