@Test public void registerExtraParametersFromAcessedUrlWithGreedyAndDottedParameters() throws SecurityException, NoSuchMethodException { DefaultParametersControl control = new DefaultParametersControl("/clients/{path.to.file*}", converters, evaluator); control.fillIntoRequest("/clients/my/path/to/file", request); verify(request).setParameter("path.to.file", new String[] {"my/path/to/file"}); }
public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i), "UTF-8")); } catch (UnsupportedEncodingException e) { logger.error("Error when decoding url parameters"); } } }
DefaultParametersControl implements ParametersControl { public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i), "UTF-8")); } catch (UnsupportedEncodingException e) { logger.error("Error when decoding url parameters"); } } } }
DefaultParametersControl implements ParametersControl { public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i), "UTF-8")); } catch (UnsupportedEncodingException e) { logger.error("Error when decoding url parameters"); } } } DefaultParametersControl(String originalPattern, Map<String, String> parameterPatterns, Converters converters, Evaluator evaluator);  DefaultParametersControl(String originalPattern, Converters converters, Evaluator evaluator); }
DefaultParametersControl implements ParametersControl { public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i), "UTF-8")); } catch (UnsupportedEncodingException e) { logger.error("Error when decoding url parameters"); } } } DefaultParametersControl(String originalPattern, Map<String, String> parameterPatterns, Converters converters, Evaluator evaluator);  DefaultParametersControl(String originalPattern, Converters converters, Evaluator evaluator); String fillUri(String[] paramNames, Object... paramValues); boolean matches(String uri); void fillIntoRequest(String uri, MutableRequest request); String apply(String[] values); }
DefaultParametersControl implements ParametersControl { public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i), "UTF-8")); } catch (UnsupportedEncodingException e) { logger.error("Error when decoding url parameters"); } } } DefaultParametersControl(String originalPattern, Map<String, String> parameterPatterns, Converters converters, Evaluator evaluator);  DefaultParametersControl(String originalPattern, Converters converters, Evaluator evaluator); String fillUri(String[] paramNames, Object... paramValues); boolean matches(String uri); void fillIntoRequest(String uri, MutableRequest request); String apply(String[] values);  }