Hi I have a script which batch converts pdfs into a series of images, what I'd like to do is count the total number of files in the directory that have the extension .jpg.
So far I have
for (file <- new File(path).listFiles) {
/* DO SOMETHING */
}
Is there a compact way of doing this without looping through each file?
Thanks in advance, much appreciated :)