Returns the permalink of a term relative-path-based.

@param string $TermRelativePath The relative path of the term

@return string
342488
protected function getTermPermalink($TermRelativePath)
    {
        if (is_null($TermRelativePath)) {
            return;
        }

        $result = $TermRelativePath;
        $basename = basename($TermRelativePath);

        if ($basename === 'index.html') {
            $result = dirname($TermRelativePath);

            if ($result === '.') {
                $result = '';
            }
        }

        return '/'.$result;
    }
1047735
private URL getRelativePath(FacesContext facesContext, String path) throws IOException
    {
        URL url = (URL) _relativePaths.get(path);
        if (url == null)
        {
            url = _factory.resolveURL(facesContext, _src, path);
            if (url != null)
            {
                ViewResource viewResource = (ViewResource) facesContext.getAttributes().get(
                    FaceletFactory.LAST_RESOURCE_RESOLVED);
                if (viewResource != null)
                {
                    // If a view resource has been used to resolve a resource, the cache is in
                    // the ResourceHandler implementation. No need to cache in _relativeLocations.
                }
                else
                {
                    _relativePaths.put(path, url);
                }
            }
        }
        return url;
    }
1182575
public function getRelativePath()
    {
        return trim(substr($this->path, strlen($this->basePath)), self::TRIM_CHARS);
    }
381145
protected function getRelativePath($path = null)
    {
        if (!isset($path)) {
            $path = $this->scanner->getInitialPath(true);
        }

        return gplcart_path_normalize(gplcart_path_relative($path));
    }
31244
public function getRelativePath()
    {
        if ($this->path === $this->basePath) {
            return '';
        }
        return substr($this->path, strlen($this->basePath) + 1);
    }
933622
protected function getPathPattern(string $relativePath): string
    {
        if (empty($relativePath)) {
            return $this->path;
        }

        return rtrim($this->path,'/') . '/' . ltrim($relativePath, '/');
    }
353315
protected static function getRelativePath($path)
	{
		preg_match('/([[:alpha:]]*):\/\/(.*)/', $path, $name);

		if (isset($name[2]) && $name[2])
		{
			return $name[2];
		}

		return $path;
	}
1215335
static function getRelativePath($path, $compareTo)
    {

        // On some windows machines the SCRIPT_FILENAME may be lower or upper case
        // compared to the target path which could be lower, upper or a mixture
        // so convert every thing lower for the comparison
        // Work out if it's Windows by looking for a back slash or a leading
        // driver specifier eg "C:"
        if (preg_match("/\\\/", $compareTo) || preg_match("/^[A-Za-z]:/", $compareTo)) {
            $compareTo = strtolower($compareTo);
            $path = strtolower($path);
        }

        // Convert Windows paths with "\" delimiters to forward delimiters
        $path = preg_replace("+\\\+", "/", $path);
        $compareTo = preg_replace("+\\\+", "/", $compareTo);

        // clean arguments by removing trailing and prefixing slashes
        if (substr($path, -1) == '/') {
            $path = substr($path, 0, -1);
        }

        if (substr($path, 0, 1) == '/') {
            $path = substr($path, 1);
        }

        if (substr($compareTo, -1) == '/') {
            $compareTo = substr($compareTo, 0, -1);
        }
        if (substr($compareTo, 0, 1) == '/') {
            $compareTo = substr($compareTo, 1);
        }

        // simple case: $compareTo is in $path
        if (strpos($path, $compareTo) === 0) {
            $offset = strlen($compareTo) + 1;
            return substr($path, $offset);
        }

        $relative = array();
        $pathParts = explode('/', $path);
        $compareToParts = explode('/', $compareTo);

        foreach ($compareToParts as $index => $part) {
            if (isset($pathParts[$index]) && $pathParts[$index] == $part) {
                continue;
            }

            $relative[] = '..';
        }

        foreach ($pathParts as $index => $part) {
            if (isset($compareToParts[$index]) && $compareToParts[$index] == $part) {
                continue;
            }

            $relative[] = $part;
        }

        return implode('/', $relative);
    }
665680
public Page getRelativePage(String relativePath) {
    String path = getRootPath();
    if (path == null) {
      return null;
    }
    StringBuilder sb = new StringBuilder(path);
    if (!relativePath.startsWith("/")) {
      sb.append("/");
    }
    sb.append(relativePath);
    return pageManager.getPage(sb.toString());
  }
140312
public static File getRelativePath(final File relativePath) {
        final String p = getRelativePathForPath(relativePath.getPath(), File.separator);
        return p != null ? new File(p) : null;
    }
1213678
@Nullable
  static SourceFile getRelativePath(String baseFilePath, String relativePath) {
    return SourceFile.fromPath(
        FileSystems.getDefault().getPath(baseFilePath).resolveSibling(relativePath).normalize(),
        UTF_8);
  }
75989
public function getUrlForRelativePath($path)
    {
        return $this->getUrlForPath(
            $this->_joinPathComponents($this->getPath(), ltrim($path, '/')));
    }
1113618
private function _correctRelativePath ($typePath, $relativePath) {
		$result = str_replace('\\', '/', $relativePath);
		if (substr($relativePath, 0, 2) == './') {
			if (self::$_viewScriptsFullPathBase === NULL)
				self::_initViewScriptsFullPathBase();
			$typedViewDirFullPath = implode('/', [
				self::$_viewScriptsFullPathBase, $typePath
			]);
			$renderedFullPaths = & $this->__protected['renderedFullPaths'];
			$lastRenderedFullPath = $renderedFullPaths[count($renderedFullPaths) - 1];
			$renderedRelPath = substr($lastRenderedFullPath, strlen($typedViewDirFullPath));
			$renderedRelPathLastSlashPos = strrpos($renderedRelPath, '/');
			if ($renderedRelPathLastSlashPos !== FALSE) {
				$result = substr($renderedRelPath, 0, $renderedRelPathLastSlashPos + 1).substr($relativePath, 2);
				$result = ltrim($result, '/');
			}
		}
		return $result;
	}
157670
public function resolveRelativePath(string $basePath, string $relativePath) : string
    {
        if (strpos($relativePath, 'data://') === 0) {
            return $relativePath;
        }

        list($basePathStreamWrapper, $basePath) = $this->splitStreamWrapperAndPath($basePath);
        list($relativeStreamWrapper, $relativePathWithoutStreamWrapper) = $this->splitStreamWrapperAndPath($relativePath);

        $isAbsolutePath = $relativeStreamWrapper !== null;

        if ($isAbsolutePath) {
            return $relativePath;
        } else {
            $relativePath = $relativePathWithoutStreamWrapper;
        }

        $basePath     = str_replace('\\', '/', $basePath);
        $relativePath = str_replace('\\', '/', $relativePath);

        if (substr($basePath, -1) !== '/') {
            $basePath .= '/';
        }

        if (strpos($relativePath, '.') === false) {
            return ($basePathStreamWrapper ? $basePathStreamWrapper . '://' : '')
            . PathHelper::normalize(str_replace('//', '/', $basePath . '/' . $relativePath));
        }

        $parts          = explode('/', $basePath);
        $relativeParts  = explode('/', trim($relativePath, '/'));
        $isDrivePath    = substr($basePath, 1, 1) === ':';
        $precedingSlash = $basePathStreamWrapper || $isDrivePath ? '' : '/';
        $trailingSlash  = !$basePathStreamWrapper && substr($relativePath, -1) === '/' ? '/' : '';

        foreach ($parts as $key => $part) {
            if ($part === '') {
                unset($parts[$key]);
            }
        }

        foreach ($relativeParts as $part) {
            if ($part === '.') {
                continue;
            } elseif ($part === '..') {
                array_pop($parts);
            } elseif ($part !== '') {
                $parts[] = $part;
            }
        }

        return ($basePathStreamWrapper ? $basePathStreamWrapper . '://' : '')
        . PathHelper::normalize($precedingSlash . implode('/', $parts) . ($parts ? $trailingSlash : ''));
    }
455866
public static function combineRelativePathWithBasePath($relativePath, $basePath)
    {
        $relativePath = self::normalizePath($relativePath);
        if ($relativePath == '') {
            return $basePath;
        }
        if ($relativePath[0] == '/') {
            return $relativePath;
        }

        $basePathSegments = explode('/', $basePath);

        preg_match('|^/?(\.\./(?:\./)*)*|', $relativePath, $match);
        $numLevelUp = strlen($match[0]) /3 + 1;
        if ($numLevelUp >= count($basePathSegments)) {
            throw new UriResolverException(sprintf("Unable to resolve URI '%s' from base '%s'", $relativePath, $basePath));
        }

        $basePathSegments = array_slice($basePathSegments, 0, -$numLevelUp);
        $path = preg_replace('|^/?(\.\./(\./)*)*|', '', $relativePath);

        return implode('/', $basePathSegments) . '/' . $path;
    }
516935
protected static function resolveRelativeToGlobal($path)
    {
        // Checks if path is relative.
        if ((strpos($path, ':') === false) && ((strlen($path) === 0) || ($path[0] !== '/'))) {
            $path = getcwd() . DIRECTORY_SEPARATOR . $path;
        }
        return $path;
    }
708148
private function getRelative($path, $against)
    {
        $relative = null;

        if (preg_replace(',/$,', '', $path) == $against ||
            Path::isBasePath($against, Path::getDirectory($path))
        ) {
            $relative = Path::makeRelative($path, $against);
            $relative = $relative ? '/'.$relative : '';
        }

        return $relative;
    }