Directly from this Java Oracle tutorial:
Two asterisks, **, works like * but crosses directory boundaries. This syntax is generally used for matching complete paths.
Could anybody do a real example out of it?
What do they mean with "crosses directory boundary"?
Crossing the directory boundary, I imagine something like checking the file from root to getNameCount()-1.
Again a real example explaining the difference between * and ** in practice would be great.
The javadoc for
FileSystem#getPathMatcher()has some pretty good examples and explanationsSo
/home/**would match/home/gus/data, but/home/*wouldn't./home/*is saying every file directly in the/homedirectory./home/**is saying every file in any directory inside/home.Example of
*vs**. Assuming your current working directory is/Users/username/workspace/myproject, then the following will only match the./myprojectfile (directory).If you use
**, it will match all folders and files within that directory.