/** {@inheritDoc} */ @Override public void dispatch(IndexChangedListener listener) { listener.onIndexChanged(this); } }
/** * Commit this change and release the lock. * <p> * If this method fails (returns false) the lock is still released. * * @return true if the commit was successful and the file contains the new * data; false if the commit failed and the file remains with the * old data. * @throws java.lang.IllegalStateException * the lock is not held. */ public boolean commit() { final LockFile tmp = myLock; requireLocked(tmp); myLock = null; if (!tmp.commit()) { return false; } snapshot = tmp.getCommitSnapshot(); if (indexChangedListener != null && !Arrays.equals(readIndexChecksum, writeIndexChecksum)) { indexChangedListener.onIndexChanged(new IndexChangedEvent(true)); } return true; }
@Override public void dispatch(IndexChangedListener listener) { listener.onIndexChanged(this); } }
/** {@inheritDoc} */ @Override public void dispatch(IndexChangedListener listener) { listener.onIndexChanged(this); } }
/** * Commit this change and release the lock. * <p> * If this method fails (returns false) the lock is still released. * * @return true if the commit was successful and the file contains the new * data; false if the commit failed and the file remains with the * old data. * @throws IllegalStateException * the lock is not held. */ public boolean commit() { final LockFile tmp = myLock; requireLocked(tmp); myLock = null; if (!tmp.commit()) return false; snapshot = tmp.getCommitSnapshot(); if (indexChangedListener != null && !Arrays.equals(readIndexChecksum, writeIndexChecksum)) indexChangedListener.onIndexChanged(new IndexChangedEvent()); return true; }
/** * Commit this change and release the lock. * <p> * If this method fails (returns false) the lock is still released. * * @return true if the commit was successful and the file contains the new * data; false if the commit failed and the file remains with the * old data. * @throws java.lang.IllegalStateException * the lock is not held. */ public boolean commit() { final LockFile tmp = myLock; requireLocked(tmp); myLock = null; if (!tmp.commit()) { return false; } snapshot = tmp.getCommitSnapshot(); if (indexChangedListener != null && !Arrays.equals(readIndexChecksum, writeIndexChecksum)) { indexChangedListener.onIndexChanged(new IndexChangedEvent(true)); } return true; }