         # File lib/ferret/index.rb, line 632
    632:     def persist(directory, create = true)
    633:       synchronize do
    634:         close_all()
    635:         old_dir = @dir
    636:         if directory.is_a?(String)
    637:           @dir = FSDirectory.new(directory, create)
    638:         elsif directory.is_a?(Ferret::Store::Directory)
    639:           @dir = directory
    640:         end
    641:         @dir.extend(MonitorMixin).extend(SynchroLockMixin)
    642:         @options[:dir] = @dir
    643:         @options[:create_if_missing] = true
    644:         add_indexes([old_dir])
    645:       end
    646:     end