/** * Recursively removes any files and subdirectories and then removes the * file (or directory) itself. * * @param f A file or directory. */ private void recursiveDelete(final File f) { if(f.isDirectory()) { final File[] children = f.listFiles(); for(int i=0; i<children.length; i++) { recursiveDelete( children[i] ); } } if(log.isInfoEnabled()) log.info("Removing: "+f); if (!f.delete()) throw new RuntimeException("Could not remove: " + f); }
/** * Recursively removes any files and subdirectories and then removes the * file (or directory) itself. * * @param f A file or directory. */ private void recursiveDelete(final File f) { if(f.isDirectory()) { final File[] children = f.listFiles(); for(int i=0; i<children.length; i++) { recursiveDelete( children[i] ); } } if(log.isInfoEnabled()) log.info("Removing: "+f); if (!f.delete()) throw new RuntimeException("Could not remove: " + f); }