Java Path Create nio createPathMatcher(String[] patterns)

Here you can find the source of createPathMatcher(String[] patterns)

Description

create Path Matcher

License

Open Source License

Declaration

private static PathMatcher[] createPathMatcher(String[] patterns) 

Method Source Code

//package com.java2s;
/******************************************************************************
 * Copyright (c) 2014 Masatomi KINO and others.
 * 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:/*from  w w w  . jav a 2 s.c  om*/
 *      Masatomi KINO - initial API and implementation
 * $Id$
 ******************************************************************************/

import java.nio.file.FileSystems;

import java.nio.file.PathMatcher;

public class Main {
    private static PathMatcher[] createPathMatcher(String[] patterns) {
        if (patterns == null) {
            return new PathMatcher[0];
        }
        int matcherSize = patterns.length;
        PathMatcher[] matchers = new PathMatcher[matcherSize];

        for (int i = 0; i < matcherSize; i++) {
            matchers[i] = FileSystems.getDefault().getPathMatcher("glob:" + patterns[i]);
        }
        return matchers;
    }
}

Related

  1. createList(Iterable dirs)
  2. createMainClassAndBuildFileWithDeps(String targetName, String deps, Path dir)
  3. createOverwriteDirectory(Path path)
  4. createPath(String fileName, String subfolder)
  5. createPathComparator()
  6. createPathOrNull(String pathString)
  7. createPathRelativizer(Path path, boolean doRelativize)
  8. createProperties(final Path directory, final Properties properties)
  9. createRandomClass(String className, Path dir)