void (final File dst) { String normPath = FileUtil.toSystemIndependentName(dst.getPath()); for (Iterator<Couple<File>> it = myUndoStorageContents.iterator(); it.hasNext(); ) { Couple<File> e = it.next(); final String p = FileUtil.toSystemIndependentName(e.first.getPath()); if (p.startsWith(normPath)) { try { FileUtil.rename(e.second, e.first); } catch (IOException ex) { LOG.error(ex); FileUtil.asyncDelete(e.second); } it.remove(); } } if (myStorageForUndo != null) { final File[] files = myStorageForUndo.listFiles(); if (files == null || files.length == 0) { FileUtil.asyncDelete(myStorageForUndo); myStorageForUndo = null; } } }