public function write(File $file)
    {
        $filename = $file->getFilename();
        if (null === $filename) {
            throw new NoFilenameGivenException();
        }
        $content = $this->contentFactory->make($file);

        try {
            $this->symfonyFilesystem->dumpFile($filename, $content, null);
        } catch (SymfonyIOException $e) {
            $message = sprintf('Failed to write "%s".', $filename);

            throw new IOException($filename, $message, $e);
        }
    }