Example usage for org.springframework.util AntPathMatcher combine

List of usage examples for org.springframework.util AntPathMatcher combine

Introduction

In this page you can find the example usage for org.springframework.util AntPathMatcher combine.

Prototype

@Override
public String combine(String pattern1, String pattern2) 

Source Link

Document

Combine two patterns into a new pattern.

Usage

From source file:org.ngrinder.infra.spring.RemainedPathMethodArgumentResolver.java

@Override
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
        NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
    AntPathMatcher pathMatcher = new AntPathMatcher();
    RequestMapping requestMappingOnMethod = parameter.getMethodAnnotation(RequestMapping.class);
    RequestMapping requestMappingOnClass = getDeclaringClassRequestMapping(parameter);
    String combine = pathMatcher.combine(requestMappingOnClass.value()[0], requestMappingOnMethod.value()[0]);
    return PathUtils.removePrependedSlash(pathMatcher.extractPathWithinPattern(combine,
            (String) webRequest.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE,
                    NativeWebRequest.SCOPE_REQUEST)));
}