When I use the File class's .delete() method to delete an empty directory, it works. However, if the directory contains files or subdirectories, it is not deleted. Is it possible for me to delete a directory, and all it's files and sub-directories in one fell swoop, without having to delete the contents first??? Any advice will be greatly appreciated. [ July 21, 2004: Message edited by: Bill Brasskey ]
Only by hand, unfortunately. I recall Java having a mechanism where you have to laboriously find out and then delete all files. Fortunately, it is rather easy.
What you could do, though, is to extend File (I don't remember if it's final or not, sorry) and reimplement the delete method to search and delete all files by default. Thus you will just call delete, and it will be all nicely accomplished without undue effort. [ July 22, 2004: Message edited by: Anton Golovin ]
Anton Golovin (email@example.com) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]