Fix case-insensitive filename.

@param string $finalTarget

@return string
965423
protected function fixCaseInsensitiveFilename($finalTarget)
    {
        $targetFile = basename($finalTarget);

        if ($this->isCaseInsensitiveFilename()) {
            $finalTarget = str_replace(
                $targetFile, StringUtils::lower($targetFile), $finalTarget
            );
        }

        return $finalTarget;
    }
663281
public function getFilename() : ?string 
    {
        if ( ! $this->hasFilename()) {
            $this->setFilename($this->getDefaultFilename());
        }
        return $this->filename;
    }
1123944
public function getFilename(string $fileStartLine): string
    {
        // In case of parse error fall back to returning the line minus the plus or minus symbols.
        if (!preg_match(static::FILENAME_REGEX, $fileStartLine, $matches)) {
            return substr($fileStartLine, 4);
        }

        return $matches['filename'];
    }
218238
private function editFileName($fileName, $isFromVendor, $siteName){
        if($isFromVendor){
            $pathInfo = explode('/', $fileName);
            for($i = 0; $i <= sizeof($pathInfo); $i++){
                if(!empty($pathInfo[1])){
                    if(str_replace('-', '', ucwords($pathInfo[1], '-')) == $siteName){
                        $fileName = preg_replace('/'.$pathInfo[1].'/', $siteName, $fileName, 1);
                    }
                }
            }
        }
        return $fileName;
    }
426211
public function getClientFilename() : string
    {
        return ($this->clientFilename === null) ? $this->fileStream->getFilename() : $this->clientFilename;
    }
166583
public function generateUniqueFilename($filename)
    {
        if (!is_string($filename) && !is_array($filename)) {
            throw new \InvalidArgumentException(sprintf(
                'The target must be a string or an array from [pathfino()], received %s',
                (is_object($filename) ? get_class($filename) : gettype($filename))
            ));
        }

        if (is_string($filename)) {
            $info = pathinfo($filename);
        } else {
            $info = $filename;
        }

        $filename = $info['filename'].'-'.uniqid();

        if (isset($info['extension']) && $info['extension']) {
            $filename .= '.'.$info['extension'];
        }

        return $filename;
    }
209552
function resolveOutputTarget(customPath, filename) {
    const realPath = path.resolve('.', customPath);

    const getPath = tryCatch(
        realPath => fs.lstatSync(realPath).isDirectory()
            ? path.join(realPath, filename)
            : realPath,
        identity);

    return getPath(realPath);
}
1213539
public static function getFilename($name): string
    {
        $originalName = str_replace('\\', '/', $name);
        $pos = strrpos($originalName, '/');
        $originalName = false === $pos ? $originalName : substr($originalName, $pos + 1);

        return $originalName;
    }
448254
public function process($filename, $actualFileName)
    {
        // Check if the processing should be done
        if(!$this->shouldProcess($filename))
        {
            // No need to process the file, so bypass
            return $this->getFinalName($filename);
        }

        // Get an instance of the LESS compiler
        $less = new lessc();

        // Otherwise write the file and return the new file name
        return $this->write($less->compileFile($filename), $actualFileName);
    }
1101534
public function buildFileName(AssetTarget $target, $timestamp = true)
    {
        $file = $target->name();
        if ($target->isThemed() && $this->theme) {
            $file = $this->theme . '-' . $file;
        }
        if ($timestamp) {
            $time = $this->getTimestamp($target);
            $file = $this->_timestampFile($file, $time);
        }
        return $file;
    }
1112844
private function resolveFileName($name): string
    {
        $filename = $this->getFilename($name);
        if ($filename === false) {
            throw new LoaderError(sprintf('Template "%s" is not defined.', $name));
        }

        return $filename;
    }
928307
protected final function fileName(string $className): string
    {
        $fileName = "";
        if (array_key_exists($className, $this->className)) {
            $fileName = $this->className[$className];
            $this->removeClass($className);
        }
        return $fileName;
    }
478652
protected function getLogFileName() {
        if (!$this->notification->getRefundDetails()->isSetAmazonRefundId()) {
            throw new InvalidArgumentException("RefundId is NULL");
        }
        
        return $this->notification->getRefundDetails()->getAmazonRefundId()."_RefundNotification.txt";
    }
880895
public function getSafeFileName()
    {
        $fileExtension = pathinfo($this->file->getClientOriginalName(), PATHINFO_EXTENSION);
        $mimeTypeExtension = $this->file->guessExtension();
        $newExtension = !empty($mimeTypeExtension) ? $mimeTypeExtension : $fileExtension;

        $baseName = !empty($fileExtension) ? basename($this->file->getClientOriginalName(), $fileExtension) : $this->file->getClientOriginalName();
        $safeBaseName = Transliterator::urlize($baseName);

        return $safeBaseName . (!empty($newExtension) ? '.' . $newExtension : '');
    }
184833
private String getFileName(MultivaluedMap<String, String> header) {

		String[] contentDisposition = header.getFirst("Content-Disposition").split(";");

		for (String filename : contentDisposition) {
			if ((filename.trim().startsWith("filename"))) {

				String[] name = filename.split("=");

				String finalFileName = name[1].trim().replaceAll("\"", "");
				return finalFileName;
			}
		}
		return "unknown";
	}
444498
protected function resolveFilename()
    {
        $filename = Yii::getAlias($this->filename);

        return preg_replace_callback('/{\\w+}/', function ($matches) {
            switch ($matches[0]) {
                case '{ts}':
                    return time();
                case '{date}':
                    return gmdate('ymd');
                case '{time}':
                    return gmdate('His');
            }
            return $matches[0];
        }, $filename);
    }
688004
protected function resolveTargetFilePath($target, $basePath)
    {
        switch (true) {

            // resource
            case strpos($target, '@') === 0:
                $targetPath = $this->fileLocator->locate($target);
                break;

            // kernel related
            case strpos($target, '/') === 0:
                $targetPath = sprintf('%s%s',
                    $this->kernelDir,
                    $target
                );
                break;

            // related file
            default:
                $targetPath = sprintf('%s/%s', $basePath, $target);
                break;
        }

        if (!is_writable($targetPath)) {
            throw new \InvalidArgumentException(sprintf(
                'Unable to resolve "%s" target, resolved into "%s" file path which is not writable.',
                $target,
                $targetPath
            ));
        }

        return $targetPath;
    }