@param string $path

@return Storage
173199
public function setPath($path)
    {
        if ($this->path) {
            $this->old_paths[] = $this->path;
        }
        $this->path = $path;

        return $this;
    }
720457
public function getUrl($path)
    {
        $path = $this->getPathFromUrl($path);
        $url = $this->storageUrl . $path;
        
        return $url;
    }
78051
public function createResource($path)
    {
        $response = $this->httpRequest($path, Requests::POST, $this);

        return $this->populate($response);
    }
257673
public function setDirectory($path) {
        if (substr($path, -1) !== '/') {
            $path .= '/';
        }

        if (!file_exists($path)) {
            mkdir($path, 0777, true);

        } else if (!is_writable($path)) {
            chmod($path, 0777);
        }

        $this->_directory = $path;

        return $this;
    }
593125
public static function createFromPath($path)
    {
        if (!is_dir($path) || !is_readable($path)) {
            throw new \LogicException(sprintf('%s does not exist or is not readable.', $path));
        }

        return static::createFromFilesystem(new Filesystem(new Local($path)));
    }
129238
public function setUploadDir($path)
	{
		$path = str_replace(' ', '_', trim($path));
		$path = Util::normalizePath($path);

		$this->uploadDir = ($path ? $path : $this->uploadDir);

		return $this;
	}
1349912
public function withPath(string $path): URI
    {
        $result = clone $this;
        $result->path = $this->filterPath($path);

        return $result;
    }
829051
protected function getObjectUrl($path)
    {
        return $this->storage->getObjectUrl($this->bucket, $path, 0, $this->getOptions);
    }
297806
protected function getObject($path)
    {
        $path = $this->applyPathPrefix($path);
        return $this->bucket->object($path);
    }
372111
public function rmdir($path)
    {
        $files = array_diff(scandir($path), array('.', '..'));
        foreach ($files as $file) {
            (is_dir("$path/$file")) ? $this->rmdir("$path/$file") : unlink("$path/$file");
        }
        return rmdir($path);
    }
755570
protected function arrGet(array $storage, $path, $default)
    {
        if ($path === null)
        {
            return $storage;
        }

        return $this->helper->arr()->get($storage, $path, $default);
    }
307395
public function addFolder(string $path): self
    {
        Arr::unShift($this->folders, $path);

        return $this;
    }
327041
public function getObject($path)
    {
        if ($path === '' || $path === '.') {
            return $this;
        }
        $data = $this->getObjectData($path);
        if ($data === false) {
            return false;
        }

        if ($data['type'] === 'blob') {
            return Blob::fromSha($data['sha'], $this->getUri(), $this->client);
        } elseif ($data['type'] === 'tree') {
            return Tree::fromSha($data['sha'], $this->getUri(), $this->client);
        }

        throw new \RuntimeException('Unrecognised object type: ' . $data['type']);
    }
205786
public function loadImage(string $path): self
    {
        $this->image = new Image($this->secret, $path, null, $this->autorotate);
        return $this;
    }
479113
public function store($path, $value)
    {
        $key = $this->getCacheKey($path);

        $this->data[$key] = $value;

        return $this;
    }
204717
public function makeDirectory($path)
    {
        $this->fs[$path] = $this->newDir();
        $this->fs[$path]->setPath($path);
        return $this->fs[$path];
    }
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;
    }