SearchFilesInSystem - ViiSE/papka GitHub Wiki
SearchFilesInSystem - Search files in filesystem system.
public SearchFilesInSystem(String beginWith)
String beginWith - name of the folder to start the search from.
/*
We have following files in 'doc' folder:
/home/doc/file1.txt
/home/doc/file2.pdf
/home/doc/file3.txt
/home/doc/file4.txt
/home/doc/file5.svg
*/
String beginWith = "/home/doc";
Search<List<File>, String> search = new SearchFilesInSystem<>(beginWith);
List<File> files = search.answer("([^.]*)(.txt$)"); // or new SearchByExt<>(search).answer(".txt");
files.forEach(file -> System.out.println(file.getName()));
Output:
file1.txt
file3.txt
file4.txt
Search - implementable interface.