void commit() throws IOException { if (wasCommitted() ) { return; } flush(true); File cur = getCurrentFile(); if (f.equals(cur)) { return; } if (f.exists() && !f.delete()) { throw new IOException("Cannot delete obsolete sigfile"); } cur.renameTo(f); shadowFile = null; }
private void doFlushFiles( @NonNull final Map<String, Map<File, CachedFileObject>> cacheLine, final boolean inCommit) throws IOException { for (Map<File, CachedFileObject> dirContent : cacheLine.values()) { for (CachedFileObject cfo : dirContent.values()) { cfo.flush(inCommit); if (inCommit) { cfo.commit(); } } } }