how to:
list all files in the folder and also sub folders
delete folder that include subfolder and files (Note :file.delete work only for empty folder)
You can try this code (based on my b4a class) to find all files...
With help of this class you should be able to get a list of all files to delete before you delete the folder