Returns if the pattern matches the given path.

@param targetPath
Path to test.

@return If the target matches TRUE, else FALSE.
519919
public final boolean matches(@NotNull final String targetPath) {
        Contract.requireArgNotNull("targetPath", targetPath);
        if (regExpr == null) {
            return true;
        }
        return regExpr.matcher(targetPath).find();
    }
502464
private boolean matchesPath(String routePath, String pathToMatch) {
        routePath = PathKit.VAR_REGEXP_PATTERN.matcher(routePath).replaceAll(PathKit.VAR_REPLACE);
        return pathToMatch.matches("(?i)" + routePath);
    }
987550
public function checkTargetPath(string $targetPath): void
    {
        if ($this->fileSystem->has($targetPath)) {
            if (! $this->config->hasOverwrite()) {
                throw new FileExistsException(sprintf('The target file "%s" already exists', $targetPath));
            }
            if ($this->config->hasBackup()) {
                $backupTarget = $targetPath . '.bak';
                if ($this->fileSystem->has($backupTarget)) {
                    throw new FileExistsException(sprintf(
                        'The backup target file "%s" already exists',
                        $backupTarget
                    ));
                }
                $this->fileSystem->copy($targetPath, $backupTarget);
            }
            $this->fileSystem->delete($targetPath);
        }
    }
1100156
public boolean classMatch(String targetClass, String templateClass)
    {
//x        if (targetClass.startsWith(Constants.ROOT_PACKAGE)) // Always
//x            targetClass = targetClass.substring(Constants.ROOT_PACKAGE.length() - 1);
//x        if (templateClass.startsWith(Constants.ROOT_PACKAGE)) // Never
//x            templateClass = templateClass.substring(Constants.ROOT_PACKAGE.length() - 1);
//x        if (targetClass.startsWith(Constants.THIN_SUBPACKAGE))
//x            if (!templateClass.startsWith(THIN_CLASS))
//x                targetClass = targetClass.substring(THIN_CLASS.length());   // Include thin classes
        if (targetClass.startsWith(BASE_CLASS))
            return true;    // Allow access to all base classes
        if (templateClass.endsWith("*"))
        {
            if (templateClass.startsWith("*"))
            	return targetClass.indexOf(templateClass.substring(1, templateClass.length() - 1)) != -1;
            return targetClass.startsWith(templateClass.substring(0, templateClass.length() - 1));
        }
        else
        {   // Exact match
            return templateClass.equalsIgnoreCase(targetClass);
        }
    }
41417
public static boolean delete(Path targetPath) {
        debug(log, "delete", targetPath);
        try {
            Files.delete(targetPath);
            return true;
        } catch (Exception e) {
            return JMExceptionManager.handleExceptionAndReturnFalse(log, e,
                    "delete", targetPath);
        }
    }
519405
public static boolean deleteAll(Path targetPath) {
        debug(log, "deleteAll", targetPath);
        return JMPath.isDirectory(targetPath) ? deleteDir(targetPath)
                : delete(targetPath);
    }
778616
private boolean pathMatches(Path path, SquigglyContext context) {
        List<SquigglyNode> nodes = context.getNodes();
        Set<String> viewStack = null;
        SquigglyNode viewNode = null;

        int pathSize = path.getElements().size();
        int lastIdx = pathSize - 1;

        for (int i = 0; i < pathSize; i++) {
            PathElement element = path.getElements().get(i);

            if (viewNode != null && !viewNode.isSquiggly()) {
                Class beanClass = element.getBeanClass();

                if (beanClass != null && !Map.class.isAssignableFrom(beanClass)) {
                    Set<String> propertyNames = getPropertyNamesFromViewStack(element, viewStack);

                    if (!propertyNames.contains(element.getName())) {
                        return false;
                    }
                }

            } else if (nodes.isEmpty()) {
                return false;
            } else {

                SquigglyNode match = findBestSimpleNode(element, nodes);

                if (match == null) {
                    match = findBestViewNode(element, nodes);

                    if (match != null) {
                        viewNode = match;
                        viewStack = addToViewStack(viewStack, viewNode);
                    }
                } else if (match.isAnyShallow()) {
                    viewNode = match;
                } else if (match.isAnyDeep()) {
                    return true;
                }

                if (match == null) {
                    if (isJsonUnwrapped(element)) {
                        continue;
                    }

                    return false;
                }

                if (match.isNegated()) {
                    return false;
                }

                nodes = match.getChildren();

                if (i < lastIdx && nodes.isEmpty() && !match.isEmptyNested() && SquigglyConfig.isFilterImplicitlyIncludeBaseFields()) {
                    nodes = BASE_VIEW_NODES;
                }
            }
        }

        return true;
    }
911723
public synchronized boolean contains(RelativePath path) {
        try {
            checkIndex();
            return getZipIndexEntry(path) != null;
        }
        catch (IOException e) {
            return false;
        }
    }
225748
public boolean matches(List<String> path) {
		if (nbAny == 0 && path.size() != nbWildcards)
			return false;
		if (path.size() < nbWildcards)
			return false;
		return check(path, 0, 0, nbWildcards, nbAny);
	}
1233988
protected void checkTarget(final File target) throws IOException {
        if (target == null) {
            throw new IOException("You must provide a target directory or file");
        }
        if (!target.exists()) {
            String extension = FilenameUtils.getExtension(target.getName());
            if (extension.length() == 0) {
                throw new IOException("Target folder " + target + " not found");
            }
        }
    }
868217
@Override
	public boolean matchPath(String path) {

		boolean match = false;
		if (StringUtils.isNotEmpty(path)) {
			match = path.startsWith(prefix);
		}
		return match;
	}
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;
    }
990889
public boolean isTemporaryPathTarget(Path path) {
    LOG.trace("isTemporaryPathTarget for {}", path);
    if (path.toString().equals(hostNameScheme) || path.getParent() == null) {
      LOG.trace("Temporary target on the path eauals hostname or null parent {}", path);
      return false;
    }
    String name = path.getName();
    String parent = path.getParent().toString();
    for (String tempPath : tempIdentifiers) {
      String[] tempPathComponents = tempPath.split("/");
      if (parent.endsWith(tempPathComponents[0].replace("ID", ""))
          || name.startsWith(tempPathComponents[0].replace("ID", ""))) {
        LOG.debug("Temporary path identified on {}", path);
        return true;
      }
    }
    LOG.debug("Temporary path not identified for {}", path);
    return false;
  }
983326
public boolean isFiltered(String path) {

        for (int j = 0; j < m_filterRules.size(); j++) {
            Pattern pattern = m_filterRules.get(j);
            if (isPartialMatch(pattern, path)) {
                return m_type.equals(TYPE_EXCLUDE);
            }
        }

        return m_type.equals(TYPE_INCLUDE);
    }
36254
public boolean contains(DistinguishedName path) {

		List shortlist = path.getNames();

		// this path must be at least as long
		if (getNames().size() < shortlist.size()) {
            return false;
        }

		// must have names
		if (shortlist.size() == 0) {
            return false;
        }

		Iterator longiter = getNames().iterator();
		Iterator shortiter = shortlist.iterator();

		LdapRdn longname = (LdapRdn) longiter.next();
		LdapRdn shortname = (LdapRdn) shortiter.next();

		// find first match
		while (!longname.equals(shortname) && longiter.hasNext()) {
			longname = (LdapRdn) longiter.next();
		}

		// Done?
		if (!shortiter.hasNext() && longname.equals(shortname)) {
            return true;
        }
		if (!longiter.hasNext()) {
            return false;
        }

		// compare
		while (longname.equals(shortname) && longiter.hasNext() && shortiter.hasNext()) {
			longname = (LdapRdn) longiter.next();
			shortname = (LdapRdn) shortiter.next();
		}

		// Done
        return !shortiter.hasNext() && longname.equals(shortname);

	}
400567
protected boolean isInTargets(String path) {

        for (CmsPair<String, String> sourceTargetPair : m_sourceTargetPairs) {
            String target = sourceTargetPair.getSecond();
            if (CmsStringUtil.joinPaths(path, "/").startsWith(CmsStringUtil.joinPaths(target, "/"))) {
                return true;
            }
        }
        return false;
    }
211216
public boolean isPathValid(String path) {
        if (StringUtils.isEmpty(path) || !path.startsWith(ZK_PATH_SEPARATOR)
                || (path.length() > 1 && path.endsWith(ZK_PATH_SEPARATOR))) {
            return false;
        }
        return true;
    }