reset

Empties the store in dir, which must not be open, leaving it as create left it: it keeps the CreationOptions it was created with, which are returned, and loses every document, deletion, type and compression dictionary. DocIds start again at 1, so a DocId, NodeRef or Cursor from before the reset may name a new document afterwards, as with a store deleted and created again. A SecondaryJsonStore open on the store keeps the state it read until its next refresh, which shows the empty store.

A crash during the reset leaves the store either as it was or empty. Only the store's metadata is read, so a store whose log or index files are too damaged to open can still be reset; files in dir that aren't the store's are left alone.

Throws StoreNotFoundException when dir holds no store, and then changes nothing; StoreLockedException when the store is open; CorruptionException when no MANIFEST of the store can be read, so its creation options are lost (delete the directory and create the store again); and java.io.IOException when the files can't be accessed.