@Override public void save(Map<?, ?> options) throws IOException { if (nonNull(this.options)) { // Check that the save options do not collide with previous load options for (Entry<?, ?> entry : options.entrySet()) { if (this.options.containsKey(entry.getKey()) && !Objects.equals(entry.getValue(), this.options.get(entry.getKey()))) { throw new InvalidOptionException(MessageFormat.format("key = {0}; value = {1}", entry.getKey().toString(), entry.getValue().toString())); } } } if (!isLoaded() || !isPersistent) { PersistenceBackend newBackend = PersistenceBackendFactoryRegistry.getFactoryProvider(uri.scheme()).createPersistentBackend(getFile(), options); PersistenceBackendFactoryRegistry.getFactoryProvider(uri.scheme()).copyBackend(backend, newBackend); this.backend = newBackend; this.store = PersistenceBackendFactoryRegistry.getFactoryProvider(uri.scheme()).createPersistentStore(this, backend, options); this.isLoaded = true; this.isPersistent = true; } backend.save(); NeoLogger.info("{0} saved: {1}", PersistentResource.class.getSimpleName(), uri); }