How to iterate through all files by mask in Java? For example, there's a mask with wild cards like
D:\work\mytestfolder\temp\*.txt Need to get a collection (or iterator or whatever else) of all *.txt files in the directory above.
Some more details. Want to process a number of files and it's convenient here to define a set of masks like those shown above. The GLOBE syntax (https://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystem.html#getPathMatcher(java.lang.String)) looks very helpful and would desirably be supported.
Files::walkwhich streams entities to you. So you split your mask on first wildcard, build a path from first part and a PathMatcher from second part, then start walking from the Path and filter the stream using PathMatcher.