Class StaticResourceRequest
- java.lang.Object
- org.springframework.boot.autoconfigure.security.reactive.StaticResourceRequest
public final class StaticResourceRequest extends Object
Used to create aServerWebExchangeMatcher
for static resources in commonly used locations. Returned byPathRequest.toStaticResources()
.- Since:
- 2.0.0
- See Also:
PathRequest
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StaticResourceRequest.StaticResourceServerWebExchange
The server web exchange matcher used to match against resourcelocations
.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StaticResourceRequest.StaticResourceServerWebExchange
at(Set<StaticResourceLocation> locations)
Returns a matcher that includes the specifiedLocations
.StaticResourceRequest.StaticResourceServerWebExchange
at(StaticResourceLocation first, StaticResourceLocation... rest)
Returns a matcher that includes the specifiedLocations
.StaticResourceRequest.StaticResourceServerWebExchange
atCommonLocations()
Returns a matcher that includes all commonly usedLocations
.
Method Detail
atCommonLocations
public StaticResourceRequest.StaticResourceServerWebExchange atCommonLocations()
Returns a matcher that includes all commonly usedLocations
. Theexcluding
method can be used to remove specific locations if required. For example:PathRequest.toStaticResources().atCommonLocations().excluding(StaticResourceLocation.CSS)
- Returns:
- the configured
ServerWebExchangeMatcher
at
public StaticResourceRequest.StaticResourceServerWebExchange at(StaticResourceLocation first, StaticResourceLocation... rest)
Returns a matcher that includes the specifiedLocations
. For example:PathRequest.toStaticResources().at(StaticResourceLocation.CSS, StaticResourceLocation.JAVA_SCRIPT)
- Parameters:
first
- the first location to includerest
- additional locations to include- Returns:
- the configured
ServerWebExchangeMatcher
at
public StaticResourceRequest.StaticResourceServerWebExchange at(Set<StaticResourceLocation> locations)
Returns a matcher that includes the specifiedLocations
. For example:PathRequest.toStaticResources().at(locations)
- Parameters:
locations
- the locations to include- Returns:
- the configured
ServerWebExchangeMatcher