/**
  * @see \qtism\runtime\storage\binary\AbstractQtiBinaryStreamAccess::writeFile()
  */
 public function writeFile(QtiFile $file)
 {
     try {
         $this->writeString($file->getPath());
     } catch (QtiBinaryStreamAccessException $e) {
         $msg = "An error occured while reading a QTI File.";
         throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::FILE, $e);
     }
 }
Ejemplo n.º 2
0
 /**
  * Delete a FileSystemFile object from the persistence.
  *
  * @throws \qtism\common\datatypes\files\FileManagerException
  */
 public function delete(QtiFile $file)
 {
     $deletion = @unlink($file->getPath());
     if ($deletion === false) {
         $msg = "The File System File located at '" . $file->getPath() . "' could not be deleted gracefully.";
         throw new FileManagerException($msg);
     }
 }