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);
        }
    }
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);
        }
    }
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 ) ; } }
Atomically writes the given File's content on the actual file.

@param File $file

@throws IOException If the file cannot be written to.
Atomically writes the given File s content on the actual file .