Java IO Tutorial - Java FileSystem .getPathMatcher (String syntaxAndPattern)








Syntax

FileSystem.getPathMatcher(String syntaxAndPattern) has the following syntax.

public abstract PathMatcher getPathMatcher(String syntaxAndPattern)

Example

In the following code shows how to use FileSystem.getPathMatcher(String syntaxAndPattern) method.

import java.io.IOException;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.PathMatcher;
/*from w  w  w.ja  v  a  2 s .  com*/
public class Main {

  public static void main(String[] args) throws IOException {
    FileSystem fileSystem = FileSystems.getDefault();
        PathMatcher matcher = fileSystem.getPathMatcher("glob:java?.exe");
  }
}