Validates the entry and the given path.<p>

@param entry the entry
@param toPath the path

@return <code>true</code> if entry and path are valid
503781
private boolean isValidEntryAndPath(CmsClientSitemapEntry entry, String toPath) {

        return ((toPath != null)
            && (CmsResource.getParentFolder(toPath) != null)
            && (entry != null)
            && (getEntry(CmsResource.getParentFolder(toPath)) != null)
            && (getEntry(entry.getSitePath()) != null));
    }
811740
private boolean isLastPage(CmsClientSitemapEntry entry) {

        return ((entry.isInNavigation() && (entry.getId().toString().equals(m_controller.getData().getReturnCode())))
            || ((entry.getDefaultFileId() != null)
                && entry.getDefaultFileId().toString().equals(m_controller.getData().getReturnCode())));
    }
392664
@Override
    public boolean apply(Map.Entry mapEntry) {
        if (predicate != null) {
            return predicate.apply(mapEntry);
        }
        return true;
    }
1251161
private boolean validateFilePath(String filePath) {
        if (filePath == null || filePath.isEmpty()) {
            throw new IllegalArgumentException("filePath must be a valid filePath within the file system.");
        }

        // Check if the filename exists as a File -- use an absolute file to ensure we have
        // a parent: even if that parent is ${user.dir} ...
        File loc = new File(filePath).getAbsoluteFile();

        return (loc.exists() || loc.getParentFile().exists());
    }
239611
public static void validatePath(String path) throws InvalidPathException {
    boolean invalid = (path == null || path.isEmpty());
    if (!OSUtils.isWindows()) {
      invalid = (invalid || !path.startsWith(AlluxioURI.SEPARATOR));
    }

    if (invalid) {
      throw new InvalidPathException(ExceptionMessage.PATH_INVALID.getMessage(path));
    }
  }
1019966
public void validate(String path, Schema schema, Object value, List<ValidationResult> results) {
		String name = path != null ? path : "value";

		if (!ObjectComparator.compare(value, _operation, _value)) {
			results.add(new ValidationResult(path, ValidationResultType.Error, "BAD_VALUE",
					name + " must " + _operation + " " + _value + " but found " + value, _operation + " " + _value,
					value));
		}
	}
629445
public static boolean isProperPrefixPath(String firstPath, String secondPath) {

        firstPath = CmsStringUtil.joinPaths(firstPath, "/");
        secondPath = CmsStringUtil.joinPaths(secondPath, "/");
        return secondPath.startsWith(firstPath) && !firstPath.equals(secondPath);

    }
1290937
public void validatePath() throws CertificateVerificationException {

        Security.addProvider(new BouncyCastleProvider());
        CollectionCertStoreParameters params = new CollectionCertStoreParameters(fullCertChain);
        try {
            CertStore store = CertStore.getInstance("Collection", params, Constants.BOUNCY_CASTLE_PROVIDER);

            // create certificate path
            CertificateFactory fact = CertificateFactory
                    .getInstance(Constants.X_509, Constants.BOUNCY_CASTLE_PROVIDER);

            CertPath certPath = fact.generateCertPath(certChain);
            TrustAnchor trustAnchor = new TrustAnchor(fullCertChain.get(fullCertChain.size() - 1), null);
            Set<TrustAnchor> trust = Collections.singleton(trustAnchor);

            // perform validation
            CertPathValidator validator = CertPathValidator
                    .getInstance(Constants.ALGORITHM, Constants.BOUNCY_CASTLE_PROVIDER);
            PKIXParameters param = new PKIXParameters(trust);

            param.addCertPathChecker(pathChecker);
            param.setRevocationEnabled(false);
            param.addCertStore(store);
            param.setDate(new Date());

            validator.validate(certPath, param);
            if (LOG.isInfoEnabled()) {
                LOG.info("Certificate path validated");
            }
        } catch (CertPathValidatorException e) {
            throw new CertificateVerificationException(
                    "Certificate path validation failed on certificate number " + e.getIndex() + ", details: " + e
                            .getMessage(), e);
        } catch (Exception e) {
            throw new CertificateVerificationException("Certificate path validation failed", e);
        }
    }
1017709
private void doMatch(final FileStatusEntry entry, final Path path)
      throws IOException {
    if (entry.refresh(path)) {
      for (final PathAlterationListener listener : listeners.values()) {
        if (entry.isDirectory()) {
          listener.onDirectoryChange(path);
        } else {
          listener.onFileChange(path);
        }
      }
    }
  }
191779
private void validatePath(PropertyEntry entry) {
        if (entry instanceof VideoEntry) {
            VideoEntry e = (VideoEntry) entry;
            if (e.getPath().contains(configuration.getRootDir().getAbsolutePath())) {
                e.setLink(e.getPath().substring(configuration.getRootDir().getAbsolutePath().length() + 1));
            }
        } else if (entry instanceof ScreenshotEntry) {
            ScreenshotEntry e = (ScreenshotEntry) entry;
            if (e.getPath().contains(configuration.getRootDir().getAbsolutePath())) {
                e.setLink(e.getPath().substring(configuration.getRootDir().getAbsolutePath().length() + 1));
            }
        }
    }
911723
public synchronized boolean contains(RelativePath path) {
        try {
            checkIndex();
            return getZipIndexEntry(path) != null;
        }
        catch (IOException e) {
            return false;
        }
    }
668646
static private boolean isAncestorPath(String x, String y) {
    if (!y.startsWith(x)) {
      return false;
    }
    final int len = x.length();
    return y.length() == len || y.charAt(len) == Path.SEPARATOR_CHAR;  
  }
194963
public static boolean entryEquals(File f1, File f2, String path) {
    return entryEquals(f1, f2, path, path);
  }
597438
public boolean add(E entry)
	{
		super.add(entry);
		
		if(this.size() > this.maxSize)
		{
			super.removeRange(0, this.size() - maxSize);
		}
		
		return true;
	}
1105621
private boolean checkRootfile( ZipInputStream zipStream,
                                   ZipEntry entry ) throws Exception {
        List<EpubMetadataProperty> properties = new ArrayList<>();
        Map<String, EpubMetadataProperty> propertiesWithId = new HashMap<>();

        ByteArrayOutputStream content = getZipEntryContent(zipStream, entry);

        // get metadata elements
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setNamespaceAware(true);
        DocumentBuilder builder = factory.newDocumentBuilder();
        Document doc = builder.parse(new ByteArrayInputStream(content.toByteArray()));

        XPathFactory xPathfactory = XPathFactory.newInstance();
        XPath xpath = xPathfactory.newXPath();
        xpath.setNamespaceContext(new SimpleNamespaceContext().setNamespace(DUBLIN_CORE_PREFIX, DUBLIN_CORE_URI));
        XPathExpression expr = xpath.compile("//" + DUBLIN_CORE_PREFIX + ":*");
        NodeList metadata = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);

        for (int i = 0; i < metadata.getLength(); i++) {
            EpubMetadataProperty property = new EpubMetadataProperty();

            Node node = metadata.item(i);
            property.setName(node.getLocalName());
            property.setValue(node.getTextContent());

            Node nodeId = node.getAttributes().getNamedItem("id");
            if (nodeId != null) {
                String id = nodeId.getTextContent();
                if (!propertiesWithId.containsKey(id)) {
                    propertiesWithId.put(id, property);
                }
            } else {
                properties.add(property);
            }
        }

        // read <meta> elements which can refine the properties
        NodeList metadataRefines = doc.getElementsByTagName("meta");
        for (int i = 0; i < metadataRefines.getLength(); i++) {
            Node node = metadataRefines.item(i);
            Node refines = node.getAttributes().getNamedItem("refines");
            if (refines != null) {
                String refinesId = refines.getTextContent().substring(1);
                if (propertiesWithId.containsKey(refinesId)) {
                    EpubMetadataProperty property = propertiesWithId.get(refinesId);

                    Node schemeAttribute = node.getAttributes().getNamedItem("scheme");
                    if (schemeAttribute != null) {
                        property.setScheme(schemeAttribute.getTextContent());
                    }

                    String propertyName = node.getAttributes().getNamedItem("property").getTextContent();
                    if (propertyName.equals("title-type")) {
                        property.setTitleType(node.getTextContent());
                    } else if (propertyName.equals("identifier-type")) {
                        property.setIdentifierType(node.getTextContent());
                    } else if (propertyName.equals("metadata-authority")) {
                        property.setMetadataAuthority(node.getTextContent());
                    } else if (propertyName.equals("role")) {
                        property.setRole(node.getTextContent());
                    } else if (propertyName.equals("display-seq")) {
                        property.setDisplaySeq(Long.parseLong(node.getTextContent()));
                    } else if (propertyName.equals("group-position")) {
                        property.setGroupPosition(Long.parseLong(node.getTextContent()));
                    } else if (propertyName.equals("file-as")) {
                        property.setFileAs(node.getTextContent());
                    } else if (propertyName.equals("alternate-script")) {
                        Node languageAttribute = node.getAttributes().getNamedItem("xml:lang");
                        if (languageAttribute != null) {
                            property.setAlternateScript(new AlternateScript(node.getTextContent(), languageAttribute.getTextContent()));
                        }
                    }
                }
            }
        }

        properties.addAll(propertiesWithId.values());
        for (EpubMetadataProperty prop : properties) {
            String propertyName = prop.getName();
            if (propertyName.equals("identifier")) {
                getIdentifier().add(prop);
            } else if (propertyName.equals("title")) {
                getTitle().add(prop);
            } else if (propertyName.equals("language")) {
                getLanguage().add(prop);
            } else if (propertyName.equals("contributor")) {
                getContributor().add(prop);
            } else if (propertyName.equals("creator")) {
                getCreator().add(prop);
            } else if (propertyName.equals("description")) {
                getDescription().add(prop);
            } else if (propertyName.equals("publisher")) {
                getPublisher().add(prop);
            } else if (propertyName.equals("rights")) {
                getRights().add(prop);
            } else if (propertyName.equals("date")) {
                getDate().add(prop);
            }
        }

        return true;
    }
994739
public void doesNotContainEntry(@NullableDecl Object key, @NullableDecl Object value) {
    checkNoNeedToDisplayBothValues("entrySet()")
        .that(actual().entrySet())
        .doesNotContain(immutableEntry(key, value));
  }
643378
public void addToPath(String path, String property) {
        Props props = pathMap.computeIfAbsent(path, k -> new Props(this, null, path));
        props.getProperties().add(property);
    }