public Map<String, String> getPathParams(String path) { Matcher matcher = getMatcher(path); if (matcher.matches()) { if (group == PathSpecGroup.EXACT) { return Collections.emptyMap(); } Map<String, String> ret = new HashMap<>(); int groupCount = matcher.groupCount(); for (int i = 1; i <= groupCount; i++) { ret.put(this.variables[i - 1],matcher.group(i)); } return ret; } return null; }
private PathSpec toPathSpec(String rawspec) { // Determine what kind of path spec we are working with if (rawspec.charAt(0) == '/' || rawspec.startsWith("*.") || rawspec.startsWith("servlet|")) { return new ServletPathSpec(rawspec); } else if (rawspec.charAt(0) == '^' || rawspec.startsWith("regex|")) { return new RegexPathSpec(rawspec); } else if (rawspec.startsWith("uri-template|")) { return new UriTemplatePathSpec(rawspec.substring("uri-template|".length())); } // TODO: add ability to load arbitrary jetty-http PathSpec implementation // TODO: perhaps via "fully.qualified.class.name|spec" style syntax throw new IllegalArgumentException("Unrecognized path spec syntax [" + rawspec + "]"); }
public PathParamServerEndpointConfig(WebSocketContainerScope containerScope, ServerEndpointConfig config, UriTemplatePathSpec pathSpec, String requestPath) { super(containerScope, config); Map<String, String> pathMap = pathSpec.getPathParams(requestPath); pathParamMap = new HashMap<>(); if (pathMap != null) { pathParamMap.putAll(pathMap); } }
if (isValidBasicLiteralCodepoint(codepoint)) if (isValidBasicLiteralCodepoint(codepoint))
if (isValidBasicLiteralCodepoint(codepoint)) if (isValidBasicLiteralCodepoint(codepoint))
public Map<String, String> getPathParams(String path) { Matcher matcher = getMatcher(path); if (matcher.matches()) { if (group == PathSpecGroup.EXACT) { return Collections.emptyMap(); } Map<String, String> ret = new HashMap<>(); int groupCount = matcher.groupCount(); for (int i = 1; i <= groupCount; i++) { ret.put(this.variables[i - 1],matcher.group(i)); } return ret; } return null; }
if (isValidBasicLiteralCodepoint(codepoint)) if (isValidBasicLiteralCodepoint(codepoint))
assertIsValidVariableLiteral(variable);
public Map<String, String> getPathParams(String path) { Matcher matcher = getMatcher(path); if (matcher.matches()) { if (group == PathSpecGroup.EXACT) { return Collections.emptyMap(); } Map<String, String> ret = new HashMap<>(); int groupCount = matcher.groupCount(); for (int i = 1; i <= groupCount; i++) { ret.put(this.variables[i - 1],matcher.group(i)); } return ret; } return null; }
if (isValidBasicLiteralCodepoint(codepoint)) if (isValidBasicLiteralCodepoint(codepoint))
public Map<String, String> getPathParams(String path) { Matcher matcher = getMatcher(path); if (matcher.matches()) { if (group == PathSpecGroup.EXACT) { return Collections.emptyMap(); } Map<String, String> ret = new HashMap<>(); int groupCount = matcher.groupCount(); for (int i = 1; i <= groupCount; i++) { ret.put(this.variables[i - 1],matcher.group(i)); } return ret; } return null; }