listFiles() should not fetch all files and filter them after then. For slow FS this is plain evil. i.e.: glob = lib/* FTP fetches all dirs in root but could rule all except fot /lib out forehand.