code: public static boolean deleteRecursive(File path) throws FileNotFoundException {
          if (!path.exists()) {
              throw new FileNotFoundException(path.getAbsolutePath());
          }
  
          boolean success = true;
          if (path.isDirectory()) {
              for (File f : path.listFiles()) {
                  success = success && FileUtils.deleteRecursive(f);
              }
          }
  
          return success && path.delete();
      }
docs: Delete all files rooted in the given path.
  
  @param path root path to delete
  
  @return <code>True</code> if all files were deleted successfully.
  
  @throws FileNotFoundException in case path couldn't be found.