function setDownloadDir($dir)
{
if (!@is_writable($dir)) {
if (PEAR::isError(System::mkdir(array('-p', $dir)))) {
return PEAR::raiseError('download directory "' . $dir . '" is not writeable. Change download_dir config variable to ' . 'a writeable dir');
}
}
$this->_downloadDir = $dir;
}