Matches a path against the registered handlers.

@param path The relative path to match
@return The match match. This will never be null, however if none matched its value field will be
358223
PathMatcher.PathMatch<HostEntry> match(String path){
        int length = path.length();
        final int[] lengths = this.lengths;
        for (int i = 0; i < lengths.length; ++i) {
            int pathLength = lengths[i];
            if (pathLength == length) {
                HostEntry next = contexts.get(path);
                if (next != null) {
                    return new PathMatcher.PathMatch<>(path, "", next);
                }
            } else if (pathLength < length) {
                char c = path.charAt(pathLength);
                if (c == '/') {
                    String part = path.substring(0, pathLength);
                    HostEntry next = contexts.get(part);
                    if (next != null) {
                        return new PathMatcher.PathMatch<>(part, path.substring(pathLength), next);
                    }
                }
            }
        }
        if(defaultHandler.contexts.isEmpty()) {
            return new PathMatcher.PathMatch<>("", path, null);
        }
        return new PathMatcher.PathMatch<>("", path, defaultHandler);
    }
660731
private boolean matchesPath(String routePath, String pathToMatch) {
		routePath = routePath.replaceAll(Path.VAR_REGEXP, Path.VAR_REPLACE);
		return pathToMatch.matches("(?i)" + routePath);
	}
271112
public boolean pathExists(String path)
    {
        String[] pathElements = path.split("/");
        ZConfig current = this;
        for (String pathElem : pathElements) {
            if (pathElem.isEmpty()) {
                continue;
            }
            current = current.children.get(pathElem);
            if (current == null) {
                return false;
            }
        }
        return true;
    }
20819
def may_contain_matches(self, path):
        
        path = self._prepare_path(path)
        return self.int_regex.search(path) is not None
1154812
public Class<? extends Actor> getActorClassForPath(String path) {
        for (Route route : routes.keySet()) {
            if (route.isRegex) {
                Pattern p = Pattern.compile(route.path);
                Matcher m = p.matcher(path);
                if (m.matches()) {
                    return routes.get(route);
                }
            } else if (route.path.equals(path)) {
                return routes.get(route);
            }
        }
        return null;
    }
783717
public static int matchPath(Struct variables, Path[] restPath, String[] callerPath) {
	if (restPath.length > callerPath.length) return -1;

	int index = 0;
	for (; index < restPath.length; index++) {
	    if (!restPath[index].match(variables, callerPath[index])) return -1;
	}
	return index - 1;
    }
40186
public Javalin get(@NotNull String path, @NotNull Handler handler) {
        return addHandler(HandlerType.GET, path, handler);
    }
272857
public boolean matches(String path, MatchingStrategy matchingStrategy) {
    return path!=null && matchingStrategy.matches(clause, path);
  }
889845
protected void checkPath(Path path) {
    URI thisUri = this.getUri();
    URI thatUri = path.toUri();
    String thatAuthority = thatUri.getAuthority();
    if (thatUri.getScheme() != null
        && thatUri.getScheme().equalsIgnoreCase(thisUri.getScheme())
        && thatUri.getPort() == NameNode.DEFAULT_PORT
        && thisUri.getPort() == -1
        && thatAuthority.substring(0,thatAuthority.indexOf(":"))
        .equalsIgnoreCase(thisUri.getAuthority()))
      return;
    super.checkPath(path);
  }
1105399
private File getFileFromPath(final String path) {
        File result = (path != null) ? new File(path) : null;
        // AS7-1752 see if a non-existent relative path exists relative to the home dir
        if (result != null && homeDir != null && !result.exists() && !result.isAbsolute()) {
            File relative = new File(homeDir, path);
            if (relative.exists()) {
                result = relative;
            }
        }
        return result;
    }
61554
public static boolean match(String filePath, String patternPath) {
    return match(new AlluxioURI(filePath), new AlluxioURI(patternPath));
  }
25212
public static String applySpecialPaths(String path) throws IllegalArgumentException {
        List<String> tokens = getTokens(path);
        if (tokens == null) { return null; }
        int i = 0;
        for (int j = 0; j < tokens.size(); j++) {
            String token = tokens.get(j);
            if (isCurrentToken(token)) { continue; } else if (isReverseToken(token)) { i--; } else { tokens.set(i++, token); }
            if (i < 0) {
                throw VFSMessages.MESSAGES.onRootPath();
            }
        }
        return getRemainingPath(tokens, 0, i);
    }
212843
public static String getClassName(String path) {
        for (Pattern pattern : patterns) {
            Matcher m = pattern.matcher(path);
            if (m.find()) {
                return m.group(1).replaceAll("[/\\\\]", ".");
            }
        }
        return null;
    }
1249593
public Map<String, String> findMatches(String incoming) {
        String[] pieces = incoming.split(PATH_SEPARATOR);
        int i = 0;

        //too many matchers, short circuit
        if (path.size() > pieces.length)
            return null;

        Map<String, String> values = new HashMap<String, String>();
        for (PathMatcher pathMatcher : path) {

            //sanity to prevent fencepost
            if (i == pieces.length)
                return pathMatcher.matches("") ? values : null;   //go greedy on index paths

            String piece = pieces[i];

            if (!pathMatcher.matches(piece))
                return null;

            //store variable as needed
            final String name = pathMatcher.name();
            if (null != name)
                values.put(name, piece);

            //next piece
            i++;
        }

        return (i == pieces.length) ? values : null;
    }
1072476
public ResultMatcher matches(final Matcher<?> matcher) {
        return new AbstractResultMatcher(path, configuration) {
            public void doMatch(Object actual) {
                isPresent(actual);
                Node node = getNode(actual);
                assertThat("Node \"" + path + "\" does not match.", node.getValue(), (Matcher<? super Object>) matcher);
            }
        };

    }
53780
@Nullable
    List<V> find(String path) {
        final Node<V> node = findNode(path, false);
        return node == null ? ImmutableList.of() : node.values();
    }
1253812
public boolean matches(LinkedList<Node> nodePath) {
        if(simplePattern) {
            // simple pattern
            return items.get(0).matches(nodePath.getLast());
        }
        // match the full pattern
        if(items.size() != nodePath.size()) {
            // different size
            return false;
        }
        for(int i=0; i<items.size(); i++) {
            if (! items.get(i).matches(nodePath.get(i))) {
                // failed a comparison
                return false;
            }
        }
        // pass all comparisons
        return true;
    }