Generate the URL for the read page for the given resource.

@param Resource|int|string $resourceOrIdentifier

@return string
503188
public function generateReadUrl($resourceOrIdentifier)
    {
        if ($resourceOrIdentifier instanceof Resource) {
            $data = $resourceOrIdentifier->toArray();
            $id = $data['username'];
        } else {
            $id = $resourceOrIdentifier;
        }

        $route = $this->router->generate(
            'ingewikkeld_rest_user_user_read',
            array('id' => $id),
            UrlGeneratorInterface::ABSOLUTE_PATH
        );

        return $route;
    }
965689
public function getUrlsafeIdentifier($model, AdminInterface $admin = null)
    {
        if (null === $admin) {
            $admin = $this->pool->getAdminByClass(ClassUtils::getClass($model));
        }

        return $admin->getUrlsafeIdentifier($model);
    }
110007
public function getResourcePath(string $resource, Theme $theme = null) : string
    {
        return $this->createPath($this->getBasePath($theme), $resource);
    }
594085
public function findRootPageByResourceNode(ResourceNode $resourceNode)
    {
        return $this->createQueryBuilder('page')
            ->leftJoin('page.website', 'website')
            ->leftJoin('website.resourceNode', 'resource')
            ->where('resource = :resourceNode')
            ->andWhere('page.type = :type')
            ->setParameter('resourceNode', $resourceNode)
            ->setParameter('type', 'root')
            ->getQuery()
            ->getSingleResult();
    }
687767
public function get(
        $root = null,
        $siteId = null,
        $pages = null,
        $pageType = null,
        $pageName = null
    ) {
        if (empty($root)) {
            $root = self::RESOURCE_SITES;
        }

        if (empty($siteId)) {
            return $root;
        }

        if (empty($pages)) {
            return $root . '.' . $siteId;
        }

        if (empty($pageType) || empty($pageName)) {
            return $root . '.' . $siteId . '.' . $pages;
        }

        return $root . '.' . $siteId . '.' . $pages . '.' . $pageType . '.' . $pageName;
    }
1151556
def get_resource_url(self):
        

        name = self.__class__.resource_name
        url = self.__class__.rest_base_url()

        if self.id is not None:
            return "%s/%s/%s" % (url, name, self.id)

        return "%s/%s" % (url, name)
1168425
protected function generateUrls(\DOMNode $environmentNode, Environment $environment)
    {
        foreach ($this->xpath->query('x:urls/x:url', $environmentNode) as $urlNode) {
            // check if the url is valid, and throw an exception otherwise
            if (!$this->checkUrlNode($urlNode)) {
                throw new InvalidUrlDefinitionException($this->webspace, $urlNode->nodeValue);
            }

            /** @var \DOMNode $urlNode */
            $url = new Url();

            $url->setUrl(rtrim($urlNode->nodeValue, '/'));

            // set optional nodes
            $url->setLanguage($this->getOptionalNodeAttribute($urlNode, 'language'));
            $url->setCountry($this->getOptionalNodeAttribute($urlNode, 'country'));
            $url->setSegment($this->getOptionalNodeAttribute($urlNode, 'segment'));
            $url->setRedirect($this->getOptionalNodeAttribute($urlNode, 'redirect'));
            $url->setMain($this->getOptionalNodeAttribute($urlNode, 'main', false));

            $environment->addUrl($url);
        }
    }
1154738
static public function getJid( $domain, $node = NULL, $resource = NULL ){
		$jid	= $domain;
		if( strlen( trim( $node ) ) ) 
			$jid	= $node.'@'.$domain;
		if( strlen( trim( $resource ) ) )
			$jid	.= "/".$resource;
		return $jid;
	}
964221
public function setResourceIdentifier($resourceIdentifier)
    {
        if (is_string($resourceIdentifier) === false) {
            $msg = "The resourceIdentifier argument must be a string.";
            throw new InvalidArgumentException($msg);
        } elseif ($resourceIdentifier === '') {
            $msg = "The resourceIdentifier argument must be a non-empty string.";
            throw new InvalidArgumentException($msg);
        } else {
            $this->resourceIdentifier = $resourceIdentifier;
        }
    }
923955
public function getPublicUrl(string $resourcePath = '/', bool $isFullUrl = false, array $fullUrlInfo = [])
    {
        $url = $this->context . $resourcePath;
        if ($isFullUrl) {
            $this->formatUrlData($fullUrlInfo);
            $prefix = $fullUrlInfo['scheme'] . '://' . $fullUrlInfo['host'];
            if (($fullUrlInfo['scheme'] == 'http') && ($fullUrlInfo['port'] != 80)) {
                $prefix .= (':' . $fullUrlInfo['port']);
            } elseif (($fullUrlInfo['scheme'] == 'https') && ($fullUrlInfo['port'] != 443)) {
                $prefix .= (':' . $fullUrlInfo['port']);
            }
            $url = $prefix . $url;
        }
        return $url;
    }
1076707
public function read(RestRouteCollection $collection, \ReflectionMethod $method, $resource)
    {
        // check that every route parent has non-empty singular name
        foreach ($this->parents as $parent) {
            if (empty($parent) || '/' === substr($parent, -1)) {
                throw new \InvalidArgumentException('Every parent controller must have `get{SINGULAR}Action(\$id)` method where {SINGULAR} is a singular form of associated object');
            }
        }

        // if method is not readable - skip
        if (!$this->isMethodReadable($method)) {
            return;
        }

        // if we can't get http-method and resources from method name - skip
        $httpMethodAndResources = $this->getHttpMethodAndResourcesFromMethod($method, $resource);
        if (!$httpMethodAndResources) {
            return;
        }

        list($httpMethod, $resources, $isCollection, $isInflectable) = $httpMethodAndResources;
        $arguments = $this->getMethodArguments($method);

        // if we have only 1 resource & 1 argument passed, then it's object call, so
        // we can set collection singular name
        if (1 === count($resources) && 1 === count($arguments) - count($this->parents)) {
            $collection->setSingularName($resources[0]);
        }

        // if we have parents passed - merge them with own resource names
        if (count($this->parents)) {
            $resources = array_merge($this->parents, $resources);
        }

        if (empty($resources)) {
            $resources[] = null;
        }

        $routeName = $httpMethod.$this->generateRouteName($resources);
        $urlParts = $this->generateUrlParts($resources, $arguments, $httpMethod);

        // if passed method is not valid HTTP method then it's either
        // a hypertext driver, a custom object (PUT) or collection (GET)
        // method
        if (!in_array($httpMethod, $this->availableHTTPMethods)) {
            $urlParts[] = $httpMethod;
            $httpMethod = $this->getCustomHttpMethod($httpMethod, $resources, $arguments);
        }

        // generated parameters
        $routeName = strtolower($routeName);
        $path = implode('/', $urlParts);
        $defaults = ['_controller' => $method->getName()];
        $requirements = [];
        $options = [];
        $host = '';
        $versionCondition = $this->getVersionCondition();
        $versionRequirement = $this->getVersionRequirement();

        $annotations = $this->readRouteAnnotation($method);
        if (!empty($annotations)) {
            foreach ($annotations as $annotation) {
                $path = implode('/', $urlParts);
                $defaults = ['_controller' => $method->getName()];
                $requirements = [];
                $options = [];
                $methods = explode('|', $httpMethod);

                $annoRequirements = $annotation->getRequirements();
                $annoMethods = $annotation->getMethods();

                if (!empty($annoMethods)) {
                    $methods = $annoMethods;
                }

                $path = null !== $annotation->getPath() ? $this->routePrefix.$annotation->getPath() : $path;
                $requirements = array_merge($requirements, $annoRequirements);
                $options = array_merge($options, $annotation->getOptions());
                $defaults = array_merge($defaults, $annotation->getDefaults());
                $host = $annotation->getHost();
                $schemes = $annotation->getSchemes();

                if ($this->hasVersionPlaceholder($path)) {
                    $combinedCondition = $annotation->getCondition();
                    $requirements = array_merge($versionRequirement, $requirements);
                } else {
                    $combinedCondition = $this->combineConditions($versionCondition, $annotation->getCondition());
                }

                $this->includeFormatIfNeeded($path, $requirements);

                // add route to collection
                $route = new Route(
                    $path, $defaults, $requirements, $options, $host, $schemes, $methods, $combinedCondition
                );
                $this->addRoute($collection, $routeName, $route, $isCollection, $isInflectable, $annotation);
            }
        } else {
            if ($this->hasVersionPlaceholder($path)) {
                $versionCondition = null;
                $requirements = $versionRequirement;
            }

            $this->includeFormatIfNeeded($path, $requirements);

            $methods = explode('|', strtoupper($httpMethod));

            // add route to collection
            $route = new Route(
                $path, $defaults, $requirements, $options, $host, [], $methods, $versionCondition
            );
            $this->addRoute($collection, $routeName, $route, $isCollection, $isInflectable);
        }
    }
1204688
public function requestUrl(ApiResourceInterface $resource)
    {
        $resourcePath = $this->resourcePath().'/'.$this->getResourceId();

        return $resource->apiUrl($resourcePath);
    }
1240505
private function get_resource_link() {
        // Get activity context only for backups.
        if ($this->backuprec->type == 'activity' && $this->type == 'backup') {
            $context = context_module::instance($this->backuprec->itemid);
        } else { // Course or Section which have the same context getter.
            $context = context_course::instance($this->backuprec->itemid);
        }

        // Generate link based on operation type.
        if ($this->type == 'backup') {
            // For backups simply generate link to restore file area UI.
            $url = new moodle_url('/backup/restorefile.php', array('contextid' => $context->id));
        } else {
            // For restore generate link to the item itself.
            $url = $context->get_url();
        }

        return $url;
    }
47530
private static function getUriForUriPointer(UriPointer $uriPointer) {

		static $uriBuilder;
		if (!$uriBuilder) {
			/** @var \Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager */
			$objectManager = Bootstrap::$staticObjectManager;

			/** @var ActionRequest $request */
			$request = new ActionRequest(Request::createFromEnvironment());

			/** @var UriBuilder $uriBuilder */
			$uriBuilder = $objectManager->get(UriBuilder::class);
			$uriBuilder->setRequest($request);

		}

		$uri = $uriBuilder
			->reset()
			->setCreateAbsoluteUri(TRUE)
			->uriFor($uriPointer->getActionName(), $uriPointer->getArguments(), $uriPointer->getControllerName(), $uriPointer->getPackageKey(), $uriPointer->getSubPackageKey());

		return $uri;
	}
975017
public function getSourceMediaFileId(): \Psr\Http\Message\UriInterface
    {
        if (!$this->sourceMediaFileId) {
            return new Uri();
        }

        return $this->sourceMediaFileId;
    }
863252
public function getResourceUrl($resource)
    {
        if (!$this->directory) {
            $this->directory = new ResourcesDirectory(
                $this->getHttpClient()->unsignedRequest('GET', $this->directoryUrl, null, true)
            );
        }

        return $this->directory->getResourceUrl($resource);
    }
280542
private static function makeRelative($location) {
    if (self::$scriptDirAbs == null) {
      self::$scriptDirAbs = dirname(FileUtil::realpath($_SERVER['SCRIPT_FILENAME'])).'/';
    }
    return URIUtil::makeRelative($location, self::$scriptDirAbs);
  }