Here you can find the source of deleteFile(final File file)
Parameter | Description |
---|---|
file | - the file to be deleted |
static void deleteFile(final File file)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**/*w ww . j a va2 s .c o m*/ * Opens a thread to delete the specified file. * * @param file * - the file to be deleted */ static void deleteFile(final File file) { new Thread(new Runnable() { @Override public void run() { while (file.exists()) { file.delete(); try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } } }).start(); } }