获取文件访问Url

@param  string $path
@return string
@throws \OSS\Core\OssException
518878
public function url($path)
    {
        $adapter = $this->driver->getAdapter();

        if ($adapter instanceof CachedAdapter) {
            $adapter = $adapter->getAdapter();
        }

        if (method_exists($adapter, 'getUrl')) {
            return $adapter->getUrl($path);
        } elseif ($adapter instanceof OssAdapter) {
            return $this->getOssUrl($adapter, $path);
        } elseif ($adapter instanceof AwsS3Adapter) {
            return $this->getAwsUrl($adapter, $path);
        } elseif ($adapter instanceof LocalAdapter) {
            return $this->getLocalUrl($path);
        } else {
            throw new RuntimeException('This driver does not support retrieving URLs.');
        }
    }
760816
protected function makeSurePathIsAbsolute($path): string
    {
        $site_url = rtrim($this->getParameter('site_url'), '/') . '/';

        if (0 !== strpos($path, 'http')) {
            return $site_url . ltrim($path, '/');
        } else {
            return $path;
        }
    }
275781
public function getUrl($path): string
    {
        \assert('is_string($path)');
        if (strpos($path, ':') === 0) {
            $key = substr($path, 0, strpos($path, '/') ?: \strlen($path));
            $path = $key === $path ? '' : (string)substr($path, \strlen($key));
        } else {
            $key = ':dist';
        }
        if (!isset($this->map[$key])) {
            throw new \InvalidArgumentException(sprintf('No path "%s" for subpackage "%s".', $path, $key));
        }
        return parent::getUrl(substr($key, 1) . $path);
    }
618413
public function get(string $path = '/')
    {
        return $this->app->request->base . implode('/', array_map('urlencode', explode('/', $path)));
    }
1353932
public function getUrl($path)
    {
        if ($this->config['cdn']) {
            return $this->applyPathPrefix($path);
        }

        $options = [
            'Scheme' => isset($this->config['scheme']) ? $this->config['scheme'] : 'http',
        ];

        $objectUrl = $this->client->getObjectUrl(
            $this->getBucket(), $path, null, $options
        );

        return $objectUrl;
    }
998457
public function url($path)
    {
        $protocol = "http" . $this->isSecure();

        return $protocol . $_SERVER['HTTP_HOST'] .$this->getBaseUri() . $path;
    }
368115
public function getSvnUrl($path)
    {
        $head = $this->head;

        if ($path instanceof Reference) {
            $head = $path;
            $path = '/';
        }

        if (null === $path) {
            $path = '/';
        }

        if (is_string($path)) {
            $path = new VcsFileInfo($path, array($head->getName(), $head->getType()));
        }

        if ($path->inBranch()) {
            $branchName = $path->getReferenceName();

            if ('trunk' === $branchName) {
                $basePath = $this->basePaths['trunk'];
            } else {
                $basePath = $this->basePaths['branches'] . '/' . $branchName;
            }
        } elseif ($path->inTag()) {
            $tagName = $path->getReferenceName();

            $basePath = $this->basePaths['tags'] . '/' . $tagName;
        }

        $retval = $this->url;
        if (isset($basePath)) {
            $retval.= '/' . $basePath;
        }

        $retval.= '/' . ltrim($path->getPathname(), '/');
        $retval = rtrim($retval, '/');

        return $retval;
    }
1185155
static public function uploadUrl($path)
    {
        if (strpos($path, 'images') === 0) {
            return Config::getRootUrl($path);
        }
        
        return Config::getUploadFileUrl($path);
    }
595783
protected function getLocalUrl($path)
    {
        $prop = $this->property();
        if ($prop instanceof FileProperty) {
            if ($prop->publicAccess() === false) {
                $query = http_build_query([
                    'disk' => $prop->filesystem(),
                    'path' => $path,
                ]);
                return $this->adminUrl('filesystem/download')->withQuery($query);
            }
        }

        return $this->baseUrl($path);
    }
693122
public function getUrl($path)
    {
        $uri = rtrim($this->storageApiUri, '/');
        $path = $this->applyPathPrefix($path);

        // Only prepend bucket name if no custom storage uri specified
        // Default: "https://storage.googleapis.com/{my_bucket}/{path_prefix}"
        // Custom: "https://example.com/{path_prefix}"
        if ($this->getStorageApiUri() === self::STORAGE_API_URI_DEFAULT) {
            $path = $this->bucket->name() . '/' . $path;
        }

        return $uri . '/' . $path;
    }
640505
protected function _getOssClient($path)
    {
        if ($this->_oss === null) {
            $url = explode(':', $path);

            if (empty($url)) {
                throw new Exception("Unable to parse URL $path");
            }

            $this->_oss = AliyunOSS::getWrapperClient($url[0]);

            if (!$this->_oss) {
                throw new Exception("Unknown client for wrapper {$url[0]}");
            }
        }

        return $this->_oss;
    }
718182
protected function getApiUrl($path) {
		// remove extra / at the beginning
		$path = ltrim($path, '/');

		// prepend protocol if not passed
		$protocol = '';
		if(strpos($this->domain, 'http://') !== 0 && strpos($this->domain, 'https://') !== 0) {
			$protocol = 'https://';
		}

		// assemble final url
		return $protocol . $this->domain . '/api/' . self::API_VERSION . '/' . $path;
	}
227005
public static function url(string $path): string
    {
        return self::SCHEME . '://' . join(
                '/',
                array_map(
                        'rawurlencode',    // ensure singe path parts are correctly urlencoded
                        explode(
                                '/',
                                str_replace('\\', '/', $path)  // ensure correct directory separator
                        )
                )
        );
    }
728906
public function getFullUrl($path)
    {
        $url = $this->getUrl($path);
                        
        if(!preg_match("/^(\\w+)\\:\\/\\//", $url)) {   
            $basePath = dirname($_SERVER['SCRIPT_NAME']);
            $domain = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';
            $domain .= htmlspecialchars($_SERVER["HTTP_HOST"]);            
            $url = "{$domain}{$basePath}/{$url}";
        }
        
        return $url;        
    }
243102
protected function urlFromRoute($path = '')
    {
        $url = $this->baseURL;
        $url[] = $path;
        if (!empty($this->page)) $url[] = '?page=' . $this->page;
        return implode('', $url);
    }
971238
public function path($path)
    {
        $path  = strtolower(trim($path));
        $first = substr($path, 0, 1);
        
        if ($first == '@' && isset($this->aliases[$path])) {
            $path = $this->aliases[$path];
            
        } elseif ($first == '/') {
            $path = preg_replace('/\\//', $this->root() . '/', $path, 1);
            
        }
        if ($path = realpath($path)) {
            $path = static::clean($path);
        }
        
        return $path;
    }
1344369
public static function slashPath($path) {
		if (UString::startswith ( $path, "/" ) === false)
			$path = "/" . $path;
		if (! UString::endswith ( $path, "/" ))
			$path = $path . "/";
		return $path;
	}