Package com.owenfeehan.pathpatternfinder
Class FindFilesRecursively
Object
com.owenfeehan.pathpatternfinder.FindFilesRecursively
public class FindFilesRecursively extends Object
Finds a list of files recursively in a directory.
- Author:
- Owen Feehan
-
Method Details
-
findFiles
public static List<Path> findFiles(Path root, Optional<String> fileFilterPattern) throws IOExceptionFinds a list of files recursively in a directory that matches a pattern- Parameters:
root
- the directory in which (as well as it's sub-directories) we search for files.fileFilterPattern
- if defined, glob-style pattern: *.jpg or *.* or * or similar. See java.nio.file.PathMatcher docs. If not defined, ignored.- Returns:
- list of all paths found
- Throws:
IOException
- if root isn't a valid directory, or something goes wrong while walking the three
-