SearchFilesInSystem - ViiSE/papka GitHub Wiki

SearchFilesInSystem

SearchFilesInSystem - Search files in filesystem system.

Constructors

public SearchFilesInSystem(String beginWith)


String beginWith - name of the folder to start the search from.

Example

/*
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

Links

Search - implementable interface.

⚠️ **GitHub.com Fallback** ⚠️