You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
773 B
26 lines
773 B
8 years ago
|
package org.libresonic.player.controller;
|
||
|
|
||
7 years ago
|
import org.springframework.util.AntPathMatcher;
|
||
|
import org.springframework.web.servlet.HandlerMapping;
|
||
|
|
||
|
import javax.servlet.http.HttpServletRequest;
|
||
|
|
||
8 years ago
|
/**
|
||
|
* This class has been created to refactor code previously present
|
||
|
* in the MultiController.
|
||
|
*/
|
||
|
public class ControllerUtils {
|
||
|
|
||
7 years ago
|
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);
|
||
|
|
||
|
}
|
||
8 years ago
|
}
|