private function saveFile($file, $path, array $options = array())
{
$className = get_class($file);
try {
$jsonData = $this->converterProvider->getJsonConverter($className)->toJson($file, $options);
} catch (ConversionFailedException $e) {
throw new InvalidConfigException(sprintf('The data written to %s could not be converted: %s', $path, $e->getMessage()), 0, $e);
}
$json = $this->encode($jsonData, $path);
$this->storage->write($path, $json);
}