Returns the uri for internal Zend_Service_Amazon_S3 use.

@param string $filename
@return string
969825
protected function _getUri($filename): string {
        $this->_verifyPath();
        // Note: AWS SDK does not want the URI to start with a slash, as opposed to the old Zend
        // Framework implementation.
        $path = trim($this->_config['path'], '/');
        return $path . '/' . $filename;
    }
887821
private function getMimeType ($fileName)
    {
        $fileExtension  = pathinfo($fileName, PATHINFO_EXTENSION);
        $mimeTypeHelper = Mimetypes::getInstance();
        $mimeType       = $mimeTypeHelper->fromExtension($fileExtension);

        return !is_null($mimeType) ? $mimeType : "application/force-download";
    }
894680
public function fetchStreamUri($key)
    {
        $filePath = $this->path;

        $this->checkFilePath($filePath);

        if ($this->denyAccess) {
            $this->options['format'] = '.php';
        }

        return sprintf(
            '%s/%s~%s' . $this->options['format'],
            $filePath,
            ($this->group) ? $this->group . '/' : $this->group,
            hash('sha1', $key)
        );
    }
505603
private function getShortPath($filename)
    {
        if (getcwd() === dirname($filename)) {
            return basename($filename);
        }
        $homeDir = Filesystem::getHomeDirectory();
        if (strpos($filename, $homeDir) === 0) {
            return str_replace($homeDir, '~', $filename);
        }

        return $filename;
    }
504737
public function path($filename)
    {
        if (preg_match('~^' . $this->base_directory . '~', $filename)) {
            return $filename;
        }

        return rtrim($this->base_directory, '/') . '/' . ltrim($filename, '/');
    }
1123847
public function pathInBase($filename)
    {
        $filename  = str_replace('\\', '/', $filename);
        $path_root = str_replace('\\', '/', base_path() . '/');

        return str_replace($path_root, '', $filename);
    }
359561
protected function getXsltUriFromFilename($filename)
    {
        // Windows requires an additional / after the scheme. If not provided then errno 22 (I/O Error: Invalid
        // Argument) will be raised. Thanks to @FnTmLV for finding the cause. See issue #284 for more information.
        // An exception to the above is when running from a Phar file; in this case the stream is handled as if on
        // linux; see issue #713 for more information on this exception.
        if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' && ! \Phar::running()) {
            $filename = '/' . $filename;
        }

        return 'file://' . $filename;
    }
294576
public static function getFileExtAttr($filename) {
        if (file_exists($filename)) {
            $fp = fileperms($filename) << 16;
            return $fp | (is_dir($filename) ? self::S_DOS_D : self::S_DOS_A);
        }
        return FALSE;
    }
393885
public function getContents(string $fileName)
    {
        if (!file_exists($this->__path . $fileName)) {
            return null;
        }
        $r = include $this->__path . $fileName;
        return $r === false ? null : $r;
    }
595501
public function findTemplateFile($filename)
    {
        foreach ($this->dir as $index => $dirname)
        {
            if (is_dir($dirname) && file_exists($dirname . '/' . $filename)) {
                return $dirname . '/' . $filename;
            }
        }

        return null;
    }
9337
public function getFileByName($filename)
    {
        $files = $this->getFiles();
        foreach ($files as $file) {
            if ($filename == $file->file) {
                return $file;
            }
        }

        return null;
    }
1357252
public function getRealUrl($url)
	{
		if (config('services.cdn.base_url')) {
			$s3_url = self::$s3_base_url . config('filesystems.disks.s3.bucket') . '/';

			return str_replace($s3_url, config('services.cdn.base_url'), $url);
		} else {
			return $url;
		}
	}
1315888
public function getFileUri($fieldName = null)
    {
        $path = self::UPLOAD_DIR_NAME . "/" . $this->getTableName();

        if ($fieldName) {
            $path .= "/" . $fieldName;
        }

        foreach ($this->getFileInfo() as $fileInfo) {
            if (isset($fileInfo["field"]) && isset($fileInfo["uri"]) && $fieldName == $fileInfo["field"]) {
                $path = $fileInfo["uri"];
                break;
            }
        }

        return $path;
    }
1315074
public function getFileUrls($filename)
    {
        if ($file = $this->findFile($filename)) {
            $parser = new Rails\Assets\Parser\Base($file);
            $parser->parse(Rails\Assets\Parser\Base::PARSE_TYPE_GET_PATHS);
            $urls = [];
            foreach ($parser->urlPaths() as $url) {
                $urls[] = $url . '?body=1';
            }
            return $urls;
        }
        return false;
    }
417257
public static function getStoreUrl($fileName = null)
    {
        $storeUrl = Yii::getAlias(Yii::$app->settings->get('storeUrl', 'attachment'));
        return $fileName ? $storeUrl . $fileName : $storeUrl;
    }
306969
public static function getFileExtension($filename)
    {
        $filename = basename($filename);

        // remove possible query string
        $pos = strpos($filename, '?');
        if ($pos !== false) {
            $filename = substr($filename, 0, $pos);
        }

        // retrieve the extension
        $pos = strrpos($filename, '.');
        if ($pos !== false) {
            return strtolower(substr($filename, $pos + 1));
        }

        return '';
    }
428602
public function locate($filename)
    {
        $basename = preg_replace('~\.[^.]+$~', '', basename($filename));

        if (isset($this->map[$basename])) {
            return $this->root . '/' . $this->map[$basename];
        }

        return null;
    }