Retrieve storage client for this stream type

@param string $path
@return BlobClient
181574
private function getStorageClient($path = '')
    {
        if ($this->storageClient === null) {
            $url = explode(':', $path);
            
            if (! $url) {
                throw new BlobException('Could not parse path "' . $path . '".');
            }
            
            $this->storageClient = self::getClient($url[0]);
            
            if (! $this->storageClient) {
                throw new BlobException('No storage client registered for stream type "' . $url[0] . '://".');
            }
        }
        
        return $this->storageClient;
    }
903923
public function objectUrl($path)
    {
        if (URL::isValidUrl($path)) {
            return $path;
        }

        if ($this->storage) {
            return $this->storage->url($path);
        }

        return Storage::disk(config('admin.upload.disk'))->url($path);
    }
860156
public static function getStoragePath($path = '')
	{
		if (function_exists('storage_path'))
		{
			return storage_path($path);
		}
		else
		{
			return (__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '../storage') . ($path ? DIRECTORY_SEPARATOR . $path : $path);
		}
	}
767967
public function get($path)
    {
        $path = self::validatePath($path);
        $fullPath = $this->getMediaPath($path);
        return $this->getStorageDisk()->get($fullPath);
    }
769263
private function serveFromCache($path)
    {
        //try and load the image from the cache
        if ($this->cache->has($path)) {
            $file = $this->cache->get($path);

            $lastModified = new \DateTime();
            $lastModified->setTimestamp($file->getTimestamp());

            $this->setHttpCacheHeaders(
                $lastModified,
                md5($this->getCachePath().$lastModified->getTimestamp()),
                $this->maxAge
            );

            // Respond with 304 not modified
            if ($this->response->isNotModified($this->request)) {
                return true;
            }

            $this->response = new StreamedResponse();

            // Set the headers
            $this->response->headers->set('Content-Type', $file->getMimetype());
            $this->response->headers->set('Content-Length', $file->getSize());

            $this->setHttpCacheHeaders(
                $lastModified,
                md5($this->getCachePath().$lastModified->getTimestamp()),
                $this->maxAge
            );

            $this->response->setCallback(function () use ($file) {
                fpassthru($file->readStream());
            });

            return true;
        }

        return false;
    }
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;
    }
901155
protected function getXStream($path)
    {
        if ($this->getFilesystem()->has($path)) {
            trigger_error('fopen(): failed to open stream: File exists', E_USER_WARNING);

            return false;
        }

        $this->needsFlush = true;

        return fopen('php://temp', 'w+b');
    }
744430
public function getFinder($path = '')
    {
        if (($protocol = array_search($this, self::$registeredWrappers))
            === false
        ) {
            $protocol = $this->registerStreamWrapper(null);
        }

        $path   = sprintf(
            "%s://%s/%s",
            $protocol,
            $this->getBucket(),
            $this->applyPathPrefix($path)
        );
        $finder = new Finder();
        $finder->in($path);

        return $finder;
    }
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;
    }
1063887
static public function getClient($name)
    {
        if (! isset(self::$clients[$name])) {
            throw new BlobException("There is no client registered for stream type '" . $name . "://");
        }
        
        return self::$clients[$name];
    }
548333
public function storagePath($path = '')
    {
        if (defined('THEMOSIS_ROOT')) {
            return $this->rootPath('storage').($path ? DIRECTORY_SEPARATOR.$path : $path);
        }

        return $this->contentPath('storage').($path ? DIRECTORY_SEPARATOR.$path : $path);
    }
340578
public function getBlob($path)
    {
        $object = $this->getObjectRecursive($path);
        if ($object === false) {
            return false;
        }
        if ($object instanceof Blob) {
            return $object;
        }
        if ($object instanceof Tree) {
            throw new GitObjectTypeException('The requested file is a directory', $path);
        }

        return false;
    }
878869
static function GetFileSystemEntryType($path)
    {
        if (is_file($path))
            return FileSystemEntryType::File();
        else if (is_link($path))
            return FileSystemEntryType::Link();
        else if (is_dir($path))
            return FileSystemEntryType::Folder();
        else
            throw new Exceptions\PathNotFoundException("Path $path not found");
    }
631871
public function download($path)
    {
        $this->setupRequest([
            'path' => $this->normalizePath($path),
        ]);

        $this->apiEndpoint = 'files/download';

        $this->content = null;

        $response = $this->doDropboxApiContentRequest();

        return StreamWrapper::getResource($response->getBody());
    }
815424
public function get($path)
    {
        return $this->settingManager->get($path, $this->tokenStorage->getToken()->getUsername());
    }
823282
protected function responseStream($path)
    {
        $response = new Response(file_get_contents($path), 200, [
            'Content-type' => 'application/pdf',
            'Content-Transfer-Encoding' => 'binary'
        ]);

        @unlink($path);

        return $response->send();
    }
1028393
protected function getContentOfType(string $path, int $type): ?vfsStreamContent
    {
        $content = $this->getContent($path);
        if (null !== $content && $content->getType() === $type) {
            return $content;
        }

        return null;
    }