Here you can find the source of waitUntilFileDeleted(File file)
private static void waitUntilFileDeleted(File file)
//package com.java2s; import java.io.*; public class Main { private static void waitUntilFileDeleted(File file) { int i = 10; while (file.exists()) { if (--i <= 0) { System.out.println("Breaking out of delete wait"); break; }/*www . j a va 2 s .c om*/ try { Thread.sleep(500); } catch (InterruptedException e) { } } } }