Here you can find the source of isExcluded(Set
Parameter | Description |
---|---|
excludes | set of exclude matchers |
path | path being examined |
public static boolean isExcluded(Set<PathMatcher> excludes, Path path)
//package com.java2s; /*/*from www .j ava 2 s. c o m*/ * Copyright (c) 2012-2018 Red Hat, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Red Hat, Inc. - initial API and implementation */ import java.nio.file.Path; import java.nio.file.PathMatcher; import java.util.Set; public class Main { /** * Checks if specified path is within excludes * * @param excludes set of exclude matchers * @param path path being examined * @return true if path is within excludes, false otherwise */ public static boolean isExcluded(Set<PathMatcher> excludes, Path path) { for (PathMatcher matcher : excludes) { if (matcher.matches(path)) { return true; } } return false; } }