You can't delete on an array ! This should work better :
for (File f : files) f.delete();
But it won't work if the folders are not empty. For this cases, you will need to recursively descend into the folder hierarchy and delete everything. Yes it's a shame Java can't do that by default...