filestream - Java How to list files with directory with pattern matcher -
the file structure following:
root -- [anything] -- access.log -- [anything] -- access.log
path: /root/*/access.log
thank you.
directoryscanner scanner = new directoryscanner(); scanner.setincludes(new string[]{"*/access.log"}); scanner.setbasedir(basepath); scanner.scan(); string[] files = scanner.getincludedfiles();
this simplest solution using org.apache.tools.ant.directoryscanner
Comments
Post a Comment