Java Wait Until File Deleted waitUntilFileDeleted(File file)

Here you can find the source of waitUntilFileDeleted(File file)

Description

wait Until File Deleted

License

Open Source License

Declaration

private static void waitUntilFileDeleted(File file) 

Method Source Code


//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) {
            }
        }
    }
}

Related

  1. waitUntilFileDeleted(File file)
  2. waitUntilFileDeleted(File file)
  3. waitUntilFileDeleted(File file)