Calls FileUtils#forceDelete(File) and throws an exception if it fails. If the file doesn't exist at all, that's fine.
(File f)
| 100 | |
| 101 | /** Calls {@link FileUtils#forceDelete(File)} and throws an exception if it fails. If the file doesn't exist at all, that's fine. */ |
| 102 | public static void forceDelete(File f) { |
| 103 | retry(f, file -> { |
| 104 | if (file.exists()) { |
| 105 | FileUtils.forceDelete(f); |
| 106 | } |
| 107 | return null; |
| 108 | }); |
| 109 | } |
| 110 | |
| 111 | private static final int MS_RETRY = 500; |
| 112 |