public static void deleteFileTreeWithRetry(Path dir) throws IOException {
  IOException ioe=null;
  final List<IOException> excs=deleteFileTreeUnchecked(dir);
  if (!excs.isEmpty()) {
    ioe=excs.remove(0);
    for (    IOException x : excs)     ioe.addSuppressed(x);
  }
  if (ioe != null)   throw ioe;
}

public static void deleteFileTreeWithRetry ( Path dir ) throws IOException { IOException ioe = null ; final List < IOException > excs = deleteFileTreeUnchecked ( dir ) ; if ( ! excs . isEmpty ( ) ) { ioe = excs . remove ( 0 ) ; for ( IOException x : excs ) ioe . addSuppressed ( x ) ; } if ( ioe != null ) throw ioe ; }
deletes a directory and its subdirectories , retrying if necessary .
