         # File lib/ferret/index.rb, line 642
    642:     def persist(directory, create = true)
    643:       synchronize do
    644:         close_all()
    645:         old_dir = @dir
    646:         if directory.is_a?(String)
    647:           @dir = FSDirectory.new(directory, create)
    648:         elsif directory.is_a?(Ferret::Store::Directory)
    649:           @dir = directory
    650:         end
    651:         @dir.extend(MonitorMixin).extend(SynchroLockMixin)
    652:         @options[:dir] = @dir
    653:         @options[:create_if_missing] = true
    654:         add_indexes([old_dir])
    655:       end
    656:     end