Hmm, this won't work if anything is removed from prunedFileList.

The moment we call prunedFileList.remove(i), the index above i would shift down by one. So, this would surely throw an ArrayIndexOutOfBoundsException.

A safer approach to iterate when you're removing things is to use a ListIterator.