Class StaticResourceRequest.StaticResourceRequestMatcher
java.lang.Object
org.springframework.boot.security.servlet.ApplicationContextRequestMatcher<org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath>
org.springframework.boot.security.autoconfigure.servlet.StaticResourceRequest.StaticResourceRequestMatcher
- All Implemented Interfaces:
org.springframework.security.web.util.matcher.RequestMatcher
- Enclosing class:
StaticResourceRequest
public static final class StaticResourceRequest.StaticResourceRequestMatcher
extends ApplicationContextRequestMatcher<org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath>
The request matcher used to match against resource
Locations.- Since:
- 4.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.security.web.util.matcher.RequestMatcher
org.springframework.security.web.util.matcher.RequestMatcher.MatchResult -
Method Summary
Modifier and TypeMethodDescriptionexcluding(Set<StaticResourceLocation> locations) Return a newStaticResourceRequest.StaticResourceRequestMatcherbased on this one but excluding the specified locations.excluding(StaticResourceLocation first, StaticResourceLocation... rest) Return a newStaticResourceRequest.StaticResourceRequestMatcherbased on this one but excluding the specified locations.protected booleanignoreApplicationContext(org.springframework.web.context.WebApplicationContext applicationContext) Returns if theWebApplicationContextshould be ignored and not used for matching.protected voidinitialized(Supplier<org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath> dispatcherServletPath) Method that can be implemented by subclasses that wish to initialize items the first time that the matcher is called.protected booleanmatches(jakarta.servlet.http.HttpServletRequest request, Supplier<org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath> context) Decides whether the rule implemented by the strategy matches the supplied request.Methods inherited from class org.springframework.boot.security.servlet.ApplicationContextRequestMatcher
matchesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.web.util.matcher.RequestMatcher
matcher
-
Method Details
-
excluding
public StaticResourceRequest.StaticResourceRequestMatcher excluding(StaticResourceLocation first, StaticResourceLocation... rest) Return a newStaticResourceRequest.StaticResourceRequestMatcherbased on this one but excluding the specified locations.- Parameters:
first- the first location to excluderest- additional locations to exclude- Returns:
- a new
StaticResourceRequest.StaticResourceRequestMatcher
-
excluding
public StaticResourceRequest.StaticResourceRequestMatcher excluding(Set<StaticResourceLocation> locations) Return a newStaticResourceRequest.StaticResourceRequestMatcherbased on this one but excluding the specified locations.- Parameters:
locations- the locations to exclude- Returns:
- a new
StaticResourceRequest.StaticResourceRequestMatcher
-
initialized
protected void initialized(Supplier<org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath> dispatcherServletPath) Description copied from class:ApplicationContextRequestMatcherMethod that can be implemented by subclasses that wish to initialize items the first time that the matcher is called. This method will be called only once and only ifApplicationContextRequestMatcher.ignoreApplicationContext(WebApplicationContext)returnsfalse. Note that the supplied context will be based on the first request sent to the matcher.- Overrides:
initializedin classApplicationContextRequestMatcher<org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath>- Parameters:
dispatcherServletPath- a supplier for the initialized context (may throw an exception)- See Also:
-
ignoreApplicationContext
protected boolean ignoreApplicationContext(org.springframework.web.context.WebApplicationContext applicationContext) Description copied from class:ApplicationContextRequestMatcherReturns if theWebApplicationContextshould be ignored and not used for matching. If this method returnstruethen the context will not be used and thematchesmethod will returnfalse.- Overrides:
ignoreApplicationContextin classApplicationContextRequestMatcher<org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath>- Parameters:
applicationContext- the candidate web application context- Returns:
- if the application context should be ignored
-
matches
protected boolean matches(jakarta.servlet.http.HttpServletRequest request, Supplier<org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath> context) Description copied from class:ApplicationContextRequestMatcherDecides whether the rule implemented by the strategy matches the supplied request.- Specified by:
matchesin classApplicationContextRequestMatcher<org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath>- Parameters:
request- the source requestcontext- a supplier for the initialized context (may throw an exception)- Returns:
- if the request matches
-