Java NIO’s PathMatcher provides FileSystem.getPathMatcher(String syntaxAndPattern):
PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:*.java");
Path filename = ...;
if (matcher.matches(filename)) {
System.out.println(filename);
}
See the Finding Files tutorial for details.
Related Contents:
- How to access a sub-file/folder in Java 7 java.nio.file.Path?
- No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
- How to combine paths in Java?
- Recursively list files in Java
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- Create whole path automatically when writing to a new file
- How to set specific Java version to Maven?
- Java: Path vs File
- Java SafeVarargs annotation, does a standard or best practice exist?
- Java 7 language features with Android
- java.nio.file.Path for a classpath resource
- How to get a path to a resource in a Java JAR file
- How to set -source 1.7 in Android Studio and Gradle
- Can Java 8 code be compiled to run on Java 7 JVM?
- Check if a path represents a file or a folder
- How should I use try-with-resources with JDBC?
- Does Java have a path joining method? [duplicate]
- Ant path style patterns
- Java: int array initializes with nonzero elements
- Why does the difference between 30 March and 1 March 2020 erroneously give 28 days instead of 29?
- What is the difference between PermGen and Metaspace?
- How to update PATH variable permanently from Windows command line?
- How to get current working directory in Java?
- After Installing Java JDK 7 For Mac OS X – mvn -version still shows java version 1.6.0_31
- Technically what is the main difference between Oracle JDK and OpenJDK? [duplicate]
- Differences in auto-unboxing between Java 6 vs Java 7
- How to add native library to “java.library.path” with Eclipse launch (instead of overriding it)
- java.lang.VerifyError: Expecting a stackmap frame at branch target JDK 1.7
- Exception in thread “main” java.lang.UnsupportedClassVersionError: a (Unsupported major.minor version 51.0) [duplicate]
- Java 7 (JDK 7) garbage collection and documentation on G1
- How to locate the Path of the current project directory in Java (IDE)?
- How Numeric literal with underscore works in java and why it was added as part of jdk 1.7 [duplicate]
- Why is StringBuilder#append(int) faster in Java 7 than in Java 8?
- When to use ** (double star) in glob syntax within JAVA
- How to install java jdk 7 on Snow Leopard
- Java access files in jar causes java.nio.file.FileSystemNotFoundException
- Why is my URI not hierarchical? [duplicate]
- InputStream from relative path
- What’s the purpose of try-with-resources statements?
- Java 7 underscore in numeric literals
- How to enable TLS 1.2 in Java 7
- Support for Compressed Strings being Dropped in HotSpot JVM?
- MethodHandle – What is it all about?
- intern() behaving differently in Java 6 and Java 7
- Setting up enviroment variables in Windows 10 to use java and javac
- Are Locks AutoCloseable?
- Programming Java 7 in Eclipse
- Maven doesn’t use Java 7
- Switch ignore case in java 7
- ClassValue in Java 7