org.yeauty.support.AntPathMatcherWraaper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of netty-websocket-spring-boot-starter Show documentation
Show all versions of netty-websocket-spring-boot-starter Show documentation
netty-websocket-spring-boot-starter is a Java WebSocket Framework based on Netty
package org.yeauty.support;
import io.netty.channel.Channel;
import io.netty.handler.codec.http.QueryStringDecoder;
import org.springframework.util.AntPathMatcher;
import java.util.LinkedHashMap;
import java.util.Map;
import static org.yeauty.pojo.PojoEndpointServer.URI_TEMPLATE;
public class AntPathMatcherWraaper extends AntPathMatcher implements WsPathMatcher {
private String pattern;
public AntPathMatcherWraaper(String pattern) {
this.pattern = pattern;
}
@Override
public String getPattern() {
return this.pattern;
}
@Override
public boolean matchAndExtract(QueryStringDecoder decoder, Channel channel) {
Map variables = new LinkedHashMap<>();
boolean result = doMatch(pattern, decoder.path(), true, variables);
if (result) {
channel.attr(URI_TEMPLATE).set(variables);
return true;
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy