code: public static void forceDelete(File file) {
          if (file.exists()) {
  
              // If the File instance to delete is a directory, delete all it's
              // contents.
              if (file.isDirectory()) {
                  for (File contentFile : file.listFiles()) {
                      forceDelete(contentFile);
                  }
              }
  
              if (file.delete()) {
                  log.d("File " + file.getPath() + " was succesfully deleted.");
              } else {
                  log.w("File " + file.getPath() + " couldn't be deleted.");
              }
          }
      }
docs: Deletes an instance of {@link File} even if it is a directory containing files.<br>
  If the file is a directory and has contents, then executes itself on every content.
  
  @see File#delete()
  @param file The {@link File} to be deleted.