I'm new here so let me know if I'm going against any rules with this question.
I have a Java app that's doing what's needed: it gets N .txt files, creates 1 thread per file, and then creates an inverted index out of all these files, outputting the result into a single .txt file.
The output is how it's supposed to be, the thread management is working just fine, but there's still something I want to improve. This is how I'm grabbing the source files:
static String Docs [] = {"path/to/file1.txt", "path/to/file2.txt"}
But I wanted to do it automatically instead of having to list all files one by one. Imagine I have like 20,000 files, it would take a lot of time to do so.
I didn't find anything related to it and my professor says it's alright the way it is, but I wanted to know how to simply feed this variable with the files inside X path instead of having to list all files.