File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
web/src/main/java/org/springframework/security/web/servlet/util/matcher Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 20
20
<property name =" avoidStaticImportExcludes" value =" org.springframework.security.web.csrf.CsrfTokenAssert.*" />
21
21
<property name =" avoidStaticImportExcludes" value =" org.springframework.security.web.servlet.TestMockHttpServletRequests.*" />
22
22
<property name =" avoidStaticImportExcludes" value =" org.springframework.security.web.util.matcher.AntPathRequestMatcher.*" />
23
+ <property name =" avoidStaticImportExcludes" value =" org.springframework.security.web.servlet.util.matcher.PathPatternRequestMatcher.*" />
23
24
<property name =" avoidStaticImportExcludes" value =" org.springframework.security.web.util.matcher.RegexRequestMatcher.*" />
24
25
<property name =" avoidStaticImportExcludes" value =" org.springframework.core.annotation.MergedAnnotations.SearchStrategy.*" />
25
26
<property name =" avoidStaticImportExcludes" value =" org.assertj.core.api.InstanceOfAssertFactories.*" />
Original file line number Diff line number Diff line change @@ -70,6 +70,40 @@ private PathPatternRequestMatcher(PathPattern pattern) {
70
70
this .pattern = pattern ;
71
71
}
72
72
73
+ /**
74
+ * Construct a {@link PathPatternRequestMatcher} using the {@link PathPatternParser}
75
+ * defaults.
76
+ * <p>
77
+ * If you are configuring a custom {@link PathPatternParser}, please use
78
+ * {@link #withPathPatternParser} instead.
79
+ * @param pattern the URI pattern to match
80
+ * @return a {@link PathPatternRequestMatcher} that matches requests to the given
81
+ * {@code pattern}
82
+ * @since 7.0
83
+ * @see PathPattern
84
+ */
85
+ public static PathPatternRequestMatcher pathPattern (String pattern ) {
86
+ return pathPattern (null , pattern );
87
+ }
88
+
89
+ /**
90
+ * Construct a {@link PathPatternRequestMatcher} using the {@link PathPatternParser}
91
+ * defaults.
92
+ * <p>
93
+ * If you are configuring a custom {@link PathPatternParser}, please use
94
+ * {@link #withPathPatternParser} instead.
95
+ * @param method the HTTP method to match, {@code null} indicates that the method does
96
+ * not matter
97
+ * @param pattern the URI pattern to match
98
+ * @return a {@link PathPatternRequestMatcher} that matches requests to the given
99
+ * {@code pattern} and {@code method}
100
+ * @since 7.0
101
+ * @see PathPattern
102
+ */
103
+ public static PathPatternRequestMatcher pathPattern (@ Nullable HttpMethod method , String pattern ) {
104
+ return withDefaults ().matcher (method , pattern );
105
+ }
106
+
73
107
/**
74
108
* Use {@link PathPatternParser#defaultInstance} to parse path patterns.
75
109
* @return a {@link Builder} that treats URIs as relative to the context path, if any
You can’t perform that action at this time.
0 commit comments