}
writeLock = directory.makeLock(WRITE_LOCK_NAME);
if (!writeLock.obtain(writeLockTimeout)) // obtain write lock
throw new LockObtainFailedException("Index locked for write: " + writeLock);
boolean success = false;
// TODO: we should check whether this index is too old,
// and throw an IndexFormatTooOldExc up front, here,