code: private static void deleteFilesOrDirectories(Collection<File> files) {
          for (File file : files.toArray(new File[files.size()])) {
              if (file.isDirectory()) {
                  try {
                      FileUtils.deleteDirectory(file);
                  } catch (IOException e) {
                      throw new RuntimeException(e);
                  }
              } else {
                  file.delete();
              }
          }
      }
docs: /