Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.nio.file.Paths;

public class Main {
    public static void main(String[] args) {
        String globPattern = "glob:**txt";
        PathMatcher matcher = FileSystems.getDefault().getPathMatcher(globPattern);
        Path path = Paths.get("C:\\Java_Dev\\test1.txt");
        boolean matched = matcher.matches(path);
        System.out.format("%s matches  %s:  %b%n", globPattern, path, matched);
    }
}