Here you can find the source of createPathMatcher(String[] patterns)
private static PathMatcher[] createPathMatcher(String[] patterns)
//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; } }