You don't need f.  You can just call new File(rootPath).  Also, no need to absolutize.