public function writeFile(File $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); } }
/** * Delete a FileSystemFile object from the persistence. * * @throws \qtism\common\datatypes\files\FileManagerException */ public function delete(File $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); } }