Presents your JAVA E-NEWSLETTER for October 28, 2002 <-------------------------------------------> REMOVE FILES RECURSIVELY Deleting a directory that contains files is not as uncomplicated as simply creating the File object and invoking delete(). To safely delete a nonempty directory in a platform-independent way, you need a small algorithm, which removes the files and then removes the directories from the bottom of the tree of directories upwards. To empty a directory of files, you simply loop over the files in the directory and call delete: static public void emptyDirectory(File directory) { File[ ] entries = directory.listFiles( ); for(int i=0; i