/** * Delete all files and folders under the temporary folder. * Usually not called directly, since it is automatically applied * by the {@link Rule} */ public void delete() { recursiveDelete(folder); }
private void recursiveDelete(File file) { File[] files= file.listFiles(); if (files != null) for (File each : files) recursiveDelete(each); file.delete(); } }