public function getUrl($path = null)
    {
        $path = $path ?: $this->path;

        if ($this->package->config('public_storage', false)) {
            // If file has public access enabled, we simply can try return storage
            // url to file.
            try {
                $useAbsolute = $this->package->config('absolute_url', false);
                $absolute = $this->storage->url($path);

                if ($useAbsolute) return $absolute;

                $relative = parse_url($absolute, PHP_URL_PATH);

                return '/' . trim($relative, '\\/');
            } catch (\Exception $ex) {
                // Some drivers does not support url method (like ftp), so we
                // simply continue and generate crip url to our controller.
            }
        }

        $service = new UrlService($this->package);
        if ($this->metadata->isFile()) {
            return $service->file($path);
        }

        return $service->folder($path);
    }