private Params parse(FullHttpRequest req) { String[] components = new QueryStringDecoder(req.uri()).path().split("/"); Preconditions.checkArgument(components.length == 4, "Unrecognized uri: %s", req.uri()); // path is start with '/' so split will give an empty component String[] cfAndCq = components[3].split(":"); Preconditions.checkArgument(cfAndCq.length == 2, "Unrecognized uri: %s", req.uri()); return new Params(components[1], components[2], cfAndCq[0], cfAndCq[1]); }
private Params parse(FullHttpRequest req) { String[] components = new QueryStringDecoder(req.uri()).path().split("/"); Preconditions.checkArgument(components.length == 4, "Unrecognized uri: %s", req.uri()); // path is start with '/' so split will give an empty component String[] cfAndCq = components[3].split(":"); Preconditions.checkArgument(cfAndCq.length == 2, "Unrecognized uri: %s", req.uri()); return new Params(components[1], components[2], cfAndCq[0], cfAndCq[1]); }