boolean (@NotNull final File file) { Boolean result = doIOOperation(new RepeatableIOOperation<Boolean, RuntimeException>() { @Override public Boolean execute(boolean lastAttempt) { if (file.delete() || !file.exists()) return Boolean.TRUE; else if (lastAttempt) return Boolean.FALSE; else return null; } }); return Boolean.TRUE.equals(result); }