def _flush_index(self):
        """Writes the current list of file paths in the index to the json file
        and then sets self.__index = None.
        """
        data = {'version': self.version, 'index': self._index}
        with open(self._get_path('index.json'), 'w') as f:
            json.dump(data, f)
        self.__index = None