Hi guys,
i am planning to perform a standard list command to get a vector or a list of the content of a directory.
I know this is easy by using
File f = new File("C:/testDir");
File[] files = f.listFiles();
The problem is that I need a list/array/vector of URLs. So my thoughts were to convert the files to URL. With the org.apache.commons.io.FileUtils library this is possible with the following simple code:
URL[] urls = FileUtils.toURLs(files);
This does exactly what I need, but is unfortunately very slow (especially for directories with thousands of files), although it is just using a for-loop and parses every single File object with the "toURL()" method.
Does someone know a way to do this task in a better performance?