Example #1
0
 /**
  * Write a new file from File.
  *
  * @param File $file File object
  *
  * @throws FileExistsException
  *
  * @return bool True on success, false on failure.
  */
 public function writeFile(File $file)
 {
     try {
         return $this->filesystem->write($file->getDirectories() . $file->getFileName(), $file->getResource(), []);
     } catch (FlysystemFileExistsException $e) {
         FileExistsException::fileExists();
     }
 }