Returns a URL that allows you to access the files in a directory
preserving the relative paths

@return string
@throws common_Exception
199427
public function getPublicAccessUrl()
    {
        if (is_null($this->accessProvider)) {
            common_Logger::e('accessss');
            throw new common_Exception('Tried obtaining access to private directory with ID ' . $this->getId());
        }
        return $this->accessProvider->getAccessUrl($this->prefix . DIRECTORY_SEPARATOR);
    }
55416
protected function currentUrlUri()
    {
        if (isset(static::$static[__FUNCTION__])) {
            return static::$static[__FUNCTION__];
        }
        if (!empty($this->options['current_url_uri'])) {
            return static::$static[__FUNCTION__] = $this->mustParseUri($this->options['current_url_uri']);
        }
        if (empty($_SERVER['REQUEST_URI'])) {
            throw new \Exception('Missing required `$_SERVER[\'REQUEST_URI\']`.');
        }
        return static::$static[__FUNCTION__] = $this->mustParseUri($_SERVER['REQUEST_URI']);
    }
1359141
public function getURL()
    {
        if ($this->cPointerExternalLink != '') {
            $link = $this->cPointerExternalLink;
        } elseif ($this->cPath) {
            $link = $this->cPath;
        } elseif ($this->cID == Page::getHomePageID()) {
            $link = DIR_REL . '/';
        } else {
            $link = DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=' . $this->cID;
        }

        return $link;
    }
9844
protected function devideUrl()
    {
        $parts = explode('/', $this->getPath());
        $cnt   = count($parts);
        for ($i = 0; $i < $cnt; $i++) {
            $parts[$i] = trim($parts[$i]);
        }
        return $parts;
    }
1364029
public function fileExists()
    {
        if (!$this->hasRequestParameter('uri') || !$this->hasRequestParameter('path') || !$this->hasRequestParameter('lang')) {
            throw new common_exception_MissingParameter();
        }

        $item = $this->getResource($this->getRequestParameter('uri'));
        $itemLang = $this->getRequestParameter('lang');

        try {
            $resolver = new ItemMediaResolver($item, $itemLang);
            $asset = $resolver->resolve($this->getRequestParameter('path'));
            $asset->getMediaSource()->getFileInfo($asset->getMediaIdentifier());
            $found = true;
        } catch (tao_models_classes_FileNotFoundException $exception) {
            $found = false;
        }
        return $this->returnJson(array(
            'exists' => $found
        ));
    }
1183404
public function getRelativePath()
    {
        $current = realpath('./');

        if ($current !== false && strpos(self::$path.'/', $current.'/') === 0) {
            return rtrim('./' . substr(self::$path, strlen($current) + 1), '\\/');
        }

        throw new \InvalidArgumentException(
            'Unable to resolve relative path to Textpattern installation location '.
            'from the current working directory.'
        );
    }
1291462
public function getCurrentUrlFolder() {
        $url = self::getCurrentUrl();
        $pieces = explode('/', $url);
        array_pop($pieces);
        $retval = implode('/', $pieces);
        return $retval;
    }
846503
public function getFilePath()
    {
        if (!$this->filePath) {
            $path = sprintf(storage_path('logs/%s'), $this->file);

            if (!file_exists($path)) {
                throw new \Exception('log not exists!');
            }

            $this->filePath = $path;
        }

        return $this->filePath;
    }
1226790
public function GetCurrentViewDirectory () {
		$result = $this->GetCurrentViewFullPath();
		$lastSlashPos = mb_strrpos($result, '/');
		if ($lastSlashPos !== FALSE) {
			$result = mb_substr($result, 0, $lastSlashPos);
		}
		return $result;
	}
758654
public function getExternalUrl()
    {
        if ($this->useCdn) {
            $path = str_replace('\\', '/', $this->getTarget());

            return $this->cdnUri . '/' . self::getDirectoryPath() . '/' . drupal_encode_path($path);
        }

        return parent::getExternalUrl();
    }
570670
public function getRelativePath()
    {
        $packageHandle = $this->getPackageHandle();
        if (is_dir($this->DIR_PACKAGES . '/' . $packageHandle)) {
            $result = $this->REL_DIR_PACKAGES . '/' . $packageHandle;
        } else {
            $result = $this->REL_DIR_PACKAGES_CORE . '/' . $packageHandle;
        }

        return $result;
    }
1037377
public function getFilePath() {

		if( isset( $this->url ) ) {

			return Yii::$app->fileManager->uploadDir . '/' . $this->url;
		}

		return false;
	}
304575
public function get_url() {

		/**
		 * Start by replacing ABSPATH with site_url.
		 * This is not accurate at all and only serves as a fallback in case everything else fails.
		 */
		$this->url = \str_replace( ABSPATH, \trailingslashit( \site_url() ), $this->path );

		/**
		 * If the file-path is inside wp-content replace the content-path with the content-url.
		 * This serves as a fallback in case the other tests below fail.
		 */
		if ( false !== \strpos( $this->path, self::$content_path ) ) {
			$this->url = \str_replace( self::$content_path, self::$content_url, $this->path );
		}

		/**
		 * If the file is in a parent theme use the template directory.
		 */
		if ( $this->in_parent_theme() ) {
			$this->url = \get_template_directory_uri() . \str_replace( \get_template_directory(), '', $this->path );
		}

		/**
		 * If the file is in a child-theme use the stylesheet directory.
		 */
		if ( ! $this->in_parent_theme() && $this->in_child_theme() ) {
			$this->url = \get_stylesheet_directory_uri() . \str_replace( \get_stylesheet_directory(), '', $this->path );
		}

		$this->url = \set_url_scheme( $this->url );
		return \apply_filters( 'kirki_path_url', $this->url, $this->path );
	}
1245005
private function urlStatDirectory()
    {
        $stats = [];
        // 1. try to look up the directory as a file
        try {
            $this->object = $this->bucket->object($this->file);
            $info = $this->object->info();

            // equivalent to 40777 and 40444 in octal
            $stats['mode'] = $this->bucket->isWritable()
                ? self::DIRECTORY_WRITABLE_MODE
                : self::DIRECTORY_READABLE_MODE;
            $this->statsFromFileInfo($info, $stats);

            return $this->makeStatArray($stats);
        } catch (NotFoundException $e) {
        } catch (ServiceException $e) {
            return false;
        }

        // 2. try list files in that directory
        try {
            $objects = $this->bucket->objects([
                'prefix' => $this->file,
            ]);

            if (!$objects->current()) {
                // can't list objects or doesn't exist
                return false;
            }
        } catch (ServiceException $e) {
            return false;
        }

        // equivalent to 40777 and 40444 in octal
        $mode = $this->bucket->isWritable()
            ? self::DIRECTORY_WRITABLE_MODE
            : self::DIRECTORY_READABLE_MODE;
        return $this->makeStatArray([
            'mode'    => $mode
        ]);
    }
1078998
public function getRoot() {
		if ($this->root) {

			if (!is_dir($this->root)) {
				throw new \Exception('Root directory not exists ' . $this->root, Consts::ERROR_CODE_NOT_EXISTS);
			}

			return realpath($this->root) . Consts::DS;
		}

		throw new \Exception('Set root directory for source', Consts::ERROR_CODE_NOT_IMPLEMENTED);
	}
229449
public function getUrl()
	{
		throw new \Exception('Dont use me bro.');

		$url = null;

		switch ($this->getResource()) {

			case self::RESOURCE_PAGE:
				$pageData = $this->getPage();

				if ( ! is_null($pageData)) {
					$url = $this->getPageFullPath($pageData);
				}
				break;

			case self::RESOURCE_FILE:
				$file = $this->getFile();

				if ($file instanceof File) {
					$fs = ObjectRepository::getFileStorage($this);
					$url = $fs->getWebPath($file);
				}

				break;

			case self::RESOURCE_LINK:
			case self::RESOURCE_EMAIL:
				$url = $this->getHref();
				break;

//			case self::RESOURCE_RELATIVE_PAGE:
//				$page = $this->getPage();
//
//				if (is_null($page)) {
//					$this->log()->warn("No page ID set or found for relative link #", $this->getId());
//					throw new ResourceNotFoundException("Invalid redirect");
//				}
//
//				$pageChildren = $page->getPublicChildren();
//
//				if ( ! $pageChildren->isEmpty()) {
//					$type = $this->getHref();
//					$relativeChild = null;
//
//					if ($type == self::RELATIVE_FIRST) {
//						$relativeChild = $pageChildren->first();
//					} else {
//						$relativeChild = $pageChildren->last();
//					}
//
//					$url = $this->getPageFullPath($relativeChild);
//				} else {
//					//throw new ResourceNotFoundException('Valid relative redirect child was not found');
//					return null;
//				}
//				break;

			default:
				$this->log()->warn("Unrecognized resource for supra html markup link tag, data: $this");
		}

		return $url;
	}
1267342
public function getPathRelativeToRoot(): string
    {
        if (is_null($this->conversion)) {
            return $this->pathGenerator->getPath($this->media).($this->media->file_name);
        }

        return $this->pathGenerator->getPathForConversions($this->media)
            .pathinfo($this->media->file_name, PATHINFO_FILENAME)
            .'-'.$this->conversion->getName()
            .'.'
            .$this->conversion->getResultExtension($this->media->extension);
    }