text: public PersistentSnapshotDeletionPolicy(IndexDeletionPolicy primary,Directory dir, OpenMode mode) throws IOException {super(primary);this.dir = dir;if (mode == OpenMode.CREATE) {clearPriorSnapshots();}loadPriorSnapshots();if (mode == OpenMode.APPEND && nextWriteGen == 0) {throw new IllegalStateException("no snapshots stored in this directory");}}