List of usage examples for org.springframework.web.util UriUtils extractFileExtension
@Nullable public static String extractFileExtension(String path)
From source file:org.springframework.web.reactive.function.server.RequestPredicates.java
/** * Return a {@code RequestPredicate} that matches if the request's path matches the given * predicate.//w w w . j a v a 2 s .co m * @param extensionPredicate the predicate to test against the request path extension * @return a predicate that matches if the given predicate matches against the request's path * file extension */ public static RequestPredicate pathExtension(Predicate<String> extensionPredicate) { Assert.notNull(extensionPredicate, "'extensionPredicate' must not be null"); return request -> { String pathExtension = UriUtils.extractFileExtension(request.path()); return extensionPredicate.test(pathExtension); }; }