public function setDownloadPath($downloadPath)
    {
        if (!is_dir($downloadPath) || !is_writable($downloadPath)) {
            trigger_error('Cannot write to directory: ' . $downloadPath, E_USER_ERROR);
        }
        $this->downloadPath = $downloadPath;
    }