Set the filename.

@param string $filename The filename.
@return QuoteProvider Returns this quote provider.
@throws FileNotFoundException Throws a file not found exception.
770521
protected function setFilename($filename) {
        if (false === realpath($filename)) {
            throw new FileNotFoundException(sprintf("The file \"%s\" was not found", $filename));
        }
        $this->filename = realpath($filename);
        return $this;
    }
1278986
public function setTemplate( $fileName )
	{
		if( empty( $fileName ) )
			return FALSE;
			
		if( !file_exists( $fileName ) )
			throw new Exception_Template( Exception_Template::FILE_NOT_FOUND, $fileName );

		$this->fileName	= $fileName;
		$this->template = file_get_contents( $fileName );
		return TRUE;
	}
114327
private function rename(string $fileName): FileInfo
	{
		$file = $this->getFileInfo($fileName);
		$file->rename = true;

		$form = $this['renameForm'];
		$form->setDefaults([
			'name' => $file->name,
			'id' => $file->name
		]);
		return $file;
	}
1131577
public function setFile( string$key, string$fileName ):self
	{
		if( !file_exists($fileName) || is_dir($fileName) || is_link($fileName) ){
			throw new Exception("$fileName is not a regular file.");
		}
		$this->files[$key]= [
			'fileName'=> $fileName,
			'contentType'=> mime_content_type($fileName),
			'content'=> file_get_contents($fileName),
		];

		return $this;
	}
969891
public function setFilename($filename)
    {
        $this->throwExceptionIfProtected();

        $pathInfo = UnicodeFunctions::pathinfo($filename);
        $extension = (isset($pathInfo['extension']) ? '.' . strtolower($pathInfo['extension']) : '');
        $this->filename = $pathInfo['filename'] . $extension;
        $this->mediaType = Utility\MediaTypes::getMediaTypeFromFilename($this->filename);
    }
715345
public function setConfigForFilename(string $filename, array $config): self
    {
        if (!isset($this->configFiles[$filename])) {
            $this->configFiles[$filename] = $filename;
        }
        
        $this->config[$filename] = $config;
        
        return $this;
    }
276797
public static function fromFile($filename): self
    {
        if (!is_readable($filename) ||
             false === ($str = file_get_contents($filename))) {
            throw new \RuntimeException("Failed to read $filename.");
        }
        return self::fromString($str);
    }
510308
public function setName($name)
    {
        $this->name = $name;
        if (isset($_FILES) && array_key_exists($name, $_FILES)) {
            $this->setValue($_FILES[$name]);
        }
        return $this;
    }
1093976
public function files($directoryName)
    {
        if (!$this->isDir($directoryName)) {
            throw new FileNotFoundException('Directory not found in the path [ ' . $directoryName . ' ].');
        }

        $files = new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator($directoryName,
                RecursiveDirectoryIterator::SKIP_DOTS
            )
        );

        return array_filter(iterator_to_array($files), 'is_file');
    }
291504
public function setFileName($filename)
    {
        $this->load();
        $this->filename = $filename;
        $this->io = new Real($filename);
    }
539997
protected function _loadFile($filename='')
    {
        if (is_null($this->_reader)) {
            $this->_reader = new Mage_Connect_Package_Reader($filename);
        }
        $content = $this->_reader->load();
        $this->_packageXml = simplexml_load_string($content);
        return $this;
    }
507771
final protected function buildClassNameByFileName($filename)
    {
        $className = sprintf('%s/%s', $this->getNamespace(), $filename);
        // Normalize it
        $className = str_replace(array('//', '/', '\\'), '\\', $className);

        return $className;
    }
1225858
public static function loadFromFile($filename)
	{
		$xmlFile = substr($filename, 0, -4) . '/plugin.xml';
		if (file_exists($xmlFile))
		{
			return self::loadFromXmlFile($xmlFile);
		}
		else
		{
			return self::loadFromPhpFile($filename);
		}
	}
311654
public function delete($filename)
    {
        if ($this->exists($filename) && $this->isFile($filename)) {
            return @unlink($filename);
        }

        throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].');
    }
1327583
public function directories($directoryName)
    {
        if (!$this->isDir($directoryName)) {
            throw new FileNotFoundException('Directory not found in the path [ ' . $directoryName . ' ].');
        }

        $iterator = new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator($directoryName,
                RecursiveDirectoryIterator::CURRENT_AS_FILEINFO)
        );

        $directories = [];

        foreach($iterator as $file) {
            if($file->isDir()) {
                if( !(substr($file,-2) === '..')) {
                    $directories[] = trim($file,'.');
                }
            }
        }

        array_shift($directories);

        return $directories;
    }
691691
public function downloadAction($filename)
    {
        $pathname = $this->getArchiver()->buildPathname($filename);

        if (!is_readable($pathname)) {
            throw $this->createNotFoundException(sprintf('Image archive "%s" is not readable.', $pathname));
        }

        return new BinaryFileResponse($pathname);
    }
824208
public function setFileName(string $fileName): self
    {
        if (!preg_match('#.pdf$#i', $fileName)) {
            $fileName .= '.pdf';
        }

        $this->fileName = System::getContainer()->get('huh.utils.file')->sanitizeFileName($fileName);

        return $this;
    }