Use FileUtils.deleteDirectory(..) instead of File.delete, since the latter cannot delete directories that are not empty.