I am trying to download multiple files that matches a pattern using threads. The pattern could match 1 or 5 or 10 files of diff sizes.
lets say for simplicity sake
Yes you can create the Threads inline.
for (final String name : fileNames){ new Thread() { public void run() { downloadFile(name, toPath); } }.start(); }