public static void delete(File resourceToDelete) throws IOException {
  if (resourceToDelete.exists()) {
    delete(resourceToDelete.toPath());
  }
}

public static void delete ( File resourceToDelete ) throws IOException { if ( resourceToDelete . exists ( ) ) { delete ( resourceToDelete . toPath ( ) ) ; } }
deletes a single file or recursively a folder with its content .
