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  www  .  j  a va2s .  c om
public class Main {

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




















Home »
  Java Tutorial »
    java.nio.file »




DirectoryStream.Filter
Files
FileStore
FileSystem
FileVisitor
Path
Paths
WatchService