/** * @param File $file * * @return bool * * @throws FileManagerException */ public function deleteFile(File $file) { $path = $file->fullPath(); if (!FileSystem::exists($path)) { throw new FileManagerException($this, 'err_file_not_found'); } if (!Perms::canDelete($path)) { throw new FileManagerException($this, 'err_file_delete_perm'); } if (FileSystem::delete($path)) { if ($file->isImage()) { $this->thumb->delete($file); } return true; } return false; }