Can we change the ordering so that we do the startsWith first, then the contains, then the new File construction? At least that way, we'd fail faster, though in a successful case we'd still drop through all of them.