Finds multiple targets for a requested route.

@param httpMethod the http method
@param path       the route path
@param acceptType the accept type
@return the targets
963677
public List<RouteMatch> findMultiple(HttpMethod httpMethod, String path, String acceptType) {
        List<RouteMatch> matchSet = new ArrayList<>();
        List<RouteEntry> routeEntries = findTargetsForRequestedRoute(httpMethod, path);

        for (RouteEntry routeEntry : routeEntries) {
            if (acceptType != null) {
                String bestMatch = MimeParse.bestMatch(Arrays.asList(routeEntry.acceptedType), acceptType);

                if (routeWithGivenAcceptType(bestMatch)) {
                    matchSet.add(new RouteMatch(routeEntry.target, routeEntry.path, path, acceptType));
                }
            } else {
                matchSet.add(new RouteMatch(routeEntry.target, routeEntry.path, path, acceptType));
            }
        }

        return matchSet;
    }
252044
protected boolean match(final String path) {

        final String methodName = "match";

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, this, path, ignoreCase, wildcard);
        }

        if (this.matcher == null) {
            if (ignoreCase) {
                if (pattern.equalsIgnoreCase(path)) {
                    return true;
                }
                if (wildcard && path.toLowerCase().startsWith(pattern)) {
                    return true;
                }
            } else {
                if (pattern.equals(path)) {
                    return true;
                }
                if (wildcard && path.startsWith(pattern)) {
                    return true;
                }
            }
        } else {
            return this.matcher.matcher(path).matches();
        }

        return false;
    }
178607
private HttpClientRequestActionBuilder request(HttpMethod method, String path) {
        HttpClientRequestActionBuilder httpClientRequestActionBuilder;
        if (httpClient != null) {
            httpClientRequestActionBuilder = new HttpClientRequestActionBuilder(action, httpClient);
        } else {
            httpClientRequestActionBuilder = new HttpClientRequestActionBuilder(action, httpClientUri);
        }

        httpClientRequestActionBuilder.withApplicationContext(applicationContext);
        httpClientRequestActionBuilder.method(method);

        if (StringUtils.hasText(path)) {
            httpClientRequestActionBuilder.path(path);
        }

        return httpClientRequestActionBuilder;
    }
358923
public HttpPost createPostMethod(final String path, final Map<String, List<String>> params) {
        return new HttpPost(repositoryURL + path + queryString(params));
    }
968537
public Router<T> addRoute(HttpMethod method, String pathPattern, T target) {
		getMethodlessRouter(method).addRoute(pathPattern, target);
		return this;
	}
1332162
public <T> ApruveResponse<List<T>> index(String path,
			GenericType<List<T>> resultType) {
		Response response = restRequest(path).get();
		List<T> responseObject = null;
		ApruveResponse<List<T>> result;
		if (response.getStatusInfo().getFamily() == Family.SUCCESSFUL) {
			responseObject = response.readEntity(resultType);
			result = new ApruveResponse<List<T>>(response.getStatus(),
					responseObject);
		} else {
			result = new ApruveResponse<List<T>>(response.getStatus(), null,
					response.readEntity(String.class));
		}
		return result;
	}
1014180
public static HttpResult executeSearch(AsyncHttpClient client, HttpMethod method, String host,
                                     String path, String searchQuery) {
        RequestBuilder requestBuilder = new RequestBuilder(method.name());

        log.debug("Executing request against host {} with path {}",host,path);
        if(searchQuery!=null) {
            requestBuilder.setBody(searchQuery);
        }

        requestBuilder.setUrl(host + path);
        try {
            Response res = client.executeRequest(requestBuilder.build(),new AsyncCompletionHandlerBase()).get();
            return new HttpResult(HttpSearchExecutionStatus.OK,res.getResponseBody());
        } catch (Exception e) {
            Throwable cause = e.getCause();
            if(cause!=null) {
                if(cause instanceof ConnectException)
                {
                    log.error("Unable to connect to {}",host,e);
                    return HttpResult.CONNECTION_FAILURE;
                }
                else if (cause instanceof TimeoutException) {
                    log.error("Request timeout talking to {}",host,e);
                    return HttpResult.REQUEST_TIMEOUT_FAILURE;
                }
                else if (cause instanceof IOException && cause.getMessage().equalsIgnoreCase("closed")) {
                    log.warn("Unable to use client, client is closed");
                    return HttpResult.CLIENT_CLOSED;
                }
                else {
                    log.error("Exception talking to {}",host,e);
                    return new HttpResult(HttpSearchExecutionStatus.REQUEST_FAILURE,null);
                }
            }
            else {
                if (e instanceof IOException && e.getMessage().equalsIgnoreCase("closed")) {
                    log.warn("Unable to use client, client is closed");
                    return HttpResult.CLIENT_CLOSED;
                } else {
                    log.error("Exception talking to {}",host,e);
                    return new HttpResult(HttpSearchExecutionStatus.REQUEST_FAILURE,null);
                }
            }
        }
    }
1263093
public static void post(String path, String acceptType, Route route) {
        getInstance().post(path, acceptType, route);
    }
379035
public static void options(String path, String acceptType, Route route) {
        getInstance().options(path, acceptType, route);
    }
726122
public Collection<String> getAllowedMethods(String requestMethod) {

		Constraint.ensureNotEmpty(requestMethod, String.format("Invalid method '%s'", requestMethod));
		Set<String> rtAllowedMethods = new HashSet<String>(allowedMethods);
		rtAllowedMethods.add(requestMethod.toUpperCase());

		return rtAllowedMethods;
	}
327693
protected function matchDynamicRoute($httpMethod, $path)
    {
        if ($routes = $this->collector->findDynamicRoutes($httpMethod, $path)) {
            // cache the parser reference
            $this->parser = $this->collector->getParser();
            // chunk routes for smaller regex groups using the Sturges' Formula
            foreach (array_chunk($routes, round(1 + 3.3 * log(count($routes))), true) as $chunk) {
                array_map([$this, "buildRoute"], $chunk);
                list($pattern, $map) = $this->buildGroup($chunk);

                if (!preg_match($pattern, $path, $matches)) {
                    continue;
                }

                /** @var Route $route */
                $route = $map[count($matches)];
                unset($matches[0]);

                $route->setParams(array_combine($route->getParams(), array_filter($matches)));

                return $route;
            }
        }

        return false;
    }
707350
boolean resolvesTo(HttpMethods hm, String p) {
		return(path.equals(p) && hm.equals(meth));
	}
934108
private static Set<Annotation> httpMethodAnnotations(Method method) {
        return getAnnotations(method, FindOption.LOOKUP_SUPER_CLASSES)
                .stream()
                .filter(annotation -> HTTP_METHOD_MAP.containsKey(annotation.annotationType()))
                .collect(Collectors.toSet());
    }
1032040
public boolean anyMatched(String[] requestPathTokens) {
		Map<String, String> pathParams = new HashMap<>();
		for (PathPattern pattern : routes.keySet()) {
			if (pattern.match(requestPathTokens, pathParams)) {
				return true;
			}

			// Reset for the next loop
			pathParams.clear();
		}

		return false;
	}
287821
static FilterImpl create(final String path, String acceptType, final Filter filter) {
        if (acceptType == null) {
            acceptType = DEFAULT_ACCEPT_TYPE;
        }
        return new FilterImpl(path, acceptType, filter) {
            @Override
            public void handle(Request request, Response response) throws Exception {
                filter.handle(request, response);
            }
        };
    }
328200
public Javalin addHandler(@NotNull HandlerType httpMethod, @NotNull String path, @NotNull Handler handler) {
        return addHandler(httpMethod, path, handler, new HashSet<>()); // no roles set for this route (open to everyone with default access manager)
    }
19768
public static Method getMethod(Object target, String methodName, Class... parameterTypes) {
        try {
            return target.getClass().getMethod(methodName, parameterTypes);
        } catch (NoSuchMethodException e) {
            throw handleException(methodName, e);
        }
    }