private void cleanStorage() { File storage = getStorageArea(); log.debugf("Deleting storage: %s", storage.getAbsolutePath()); try { deleteRecursively(storage); } catch (IOException ex) { log.errorf(ex, "Cannot delete storage area"); } }
private void deleteRecursively(File file) throws IOException { if (file.isDirectory()) { for (File aux : file.listFiles()) deleteRecursively(aux); } file.delete(); }