Search in sources :

Example 11 with AntPathMatcher

use of org.springframework.util.AntPathMatcher in project libresonic by Libresonic.

the class ControllerUtils method extractMatched.

public static String extractMatched(final HttpServletRequest request) {
    String path = (String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);
    String bestMatchPattern = (String) request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE);
    AntPathMatcher apm = new AntPathMatcher();
    return apm.extractPathWithinPattern(bestMatchPattern, path);
}
Also used : AntPathMatcher(org.springframework.util.AntPathMatcher)

Aggregations

AntPathMatcher (org.springframework.util.AntPathMatcher)11 Test (org.junit.Test)7 TestPrincipal (org.springframework.messaging.simp.TestPrincipal)2 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 Before (org.junit.Before)1 ClassPathBeanDefinitionScanner (org.springframework.context.annotation.ClassPathBeanDefinitionScanner)1 Resource (org.springframework.core.io.Resource)1 ResourceLoader (org.springframework.core.io.ResourceLoader)1 PathMatchingResourcePatternResolver (org.springframework.core.io.support.PathMatchingResourcePatternResolver)1 PathMatcher (org.springframework.util.PathMatcher)1 HandlerInterceptor (org.springframework.web.servlet.HandlerInterceptor)1 MappedInterceptor (org.springframework.web.servlet.handler.MappedInterceptor)1