Tries to transform the provided location data into a server URI

@param string $location Location name, path or identifier
@param array $options Filter options

@return UriInterface|null
166485
public function transform($location, array $options = [])
    {
        $regexp = '/((https?\:|\/\/).*)/i';
        if (preg_match($regexp, $location)) {
            return new CustomUri($location);
        }
        return null;
    }
473251
public function generate($location, array $options = [])
    {
        $uri = $this->fetchUrl($location, $options);
        $this->decorate($uri);
        return $uri;
    }
937114
private function generateResourceUri($options)
    {
        $resource_uri = "";

        // resource_uri + bucket
        if (isset($options[self::OSS_BUCKET]) && '' !== $options[self::OSS_BUCKET]) {
            if ($this->hostType === self::OSS_HOST_TYPE_IP) {
                $resource_uri = '/' . $options[self::OSS_BUCKET];
            }
        }

        // resource_uri + object
        if (isset($options[self::OSS_OBJECT]) && '/' !== $options[self::OSS_OBJECT]) {
            $resource_uri .= '/' . str_replace(array('%2F', '%25'), array('/', '%'), rawurlencode($options[self::OSS_OBJECT]));
        }

        // resource_uri + sub_resource
        $conjunction = '?';
        if (isset($options[self::OSS_SUB_RESOURCE])) {
            $resource_uri .= $conjunction . $options[self::OSS_SUB_RESOURCE];
        }
        return $resource_uri;
    }
963961
public function load(Location $location): self
    {
        $customUrlAliases = $this->urlAliasService->listLocationAliases($location, true, null, true);
        $this->data = array_map(
            function (URLAlias $urlAlias) {
                return $this->valueFactory->createUrlAlias($urlAlias);
            },
            $customUrlAliases
        );

        return $this;
    }
441230
private function resolveLocation(array $parameters): ?Location
    {
        if (isset($parameters['locationId'])) {
            return $this->loadLocation((int) $parameters['locationId']);
        }

        if (isset($parameters['location'])) {
            return $parameters['location'];
        }

        return null;
    }
219519
public static function redirect($location, $permanent = false)
    {
        $redirect = new static($permanent ? 301 : 302);
        $redirect->setHeader('Location', $location);

        return $redirect;
    }
1262370
public static function get($uri, $options=[])
    {
      if ($token = self::$_config->get('ACCESS_TOKEN')) {
        $uri = $uri . "?access_token=" . $token;
      }
      return self::$_restClient->get($uri, $options);
    }
680381
private function redirect($location)
    {
        $locationUrl = new Url($location);

        // if the location header was relative (bleh) add the host
        if (!$locationUrl->hasHost()) {
            $locationUrl = $this->url->getUrlForPath($location);
        }

        if ($this->redirects > self::MAXredirects) {
            throw new Error\BadRequest("Exceeded maximum redirects");
        }

        $this->redirects++;

        return $this->dispatchRequest(
            new Request('GET', $locationUrl, $this->headers)
        );
    }
794553
public function redirect($nextUrl, $location = true, $data = null) {
		if ($nextUrl{0} == '/') $nextUrl = substr($nextUrl, 1);
		if (strlen($nextUrl) < 8 || (substr($nextUrl, 0, 7) != 'http://' && substr($nextUrl, 0, 8) != 'https://')) {
			$nextUrl = $this->config->baseUrl().$nextUrl;
		}
		if ($location) {
			header("Location:$nextUrl");	
		}
		$this->app->finish(0);
	}
1278316
public function getHandler(Location $location)
    {
        if ( null === $this->handlerProvider )
        {
            return new NullHandler();
        }

        return $this->handlerProvider->getHandler( $location );
    }
1094314
final public function redirect($url = '', $options = array(), $full = false, $nolangcode = false)
    {
        if (!isset($url)) {
            return null;
        }

        if (!empty($url) && ($full || $this->isAbsolute($url))) {
            $url = filter_var($url, FILTER_SANITIZE_URL);
        } else {

            $target = $this->request->get('target', '', 'string');

            if (!empty($target)) {
                $url = (string) parse_url($target, PHP_URL_PATH);
                $parsed = parse_url($target, PHP_URL_QUERY);
                $options = is_array($parsed) ? $parsed : array();
            }

            $url = $this->get($url, $options, false, $nolangcode);
        }

        header("Location: $url");
        exit;
    }
662616
public static function convertLocationCoordinates(Location $location)
    {
        $coordinates = $location->getCoordinates()->getCoordinates();
        $coordinate = doubleval($coordinates[1]) . '%' . doubleval($coordinates[0]);
        $coordinate = strtr($coordinate, [
            '%'=>',',
            ','=>'.'
        ]);
        return $coordinate;
    }
915435
public function transform(LocationInterface $location)
    {
        return $this
            ->locationDataFactory
            ->create(
                $location->getId(),
                $location->getName(),
                $location->getCode(),
                $location->getType()
            );
    }
755669
public function save(string $location = null): FedoraResource {
        if ($this->uri != '') {
            $meta = $this->getMetadata();
            $meta->merge($this->getAclMetadata(), [RC::idProp()]);
            $this->setMetadata($meta);
            $this->updateMetadata();
        } else {
            if ($location === null) {
                throw new InvalidArgumentException('location parameter missing');
            }

            $meta      = $this->getAclMetadata();
            $meta->addResource(RC::idProp(), 'https://id.acdh.oeaw.ac.at/acl/' . microtime(true) . rand(0, 1000));
            $res       = $this->fedora->createResource($meta, '', $location, 'POST');
            $this->uri = $res->getUri();
            $this->fedora->getCache()->delete($res);
            $this->fedora->getCache()->add($this);
        }
        return $this;
    }
1184136
public function sbDeleteRootDir($location)
    {
        $uri = 'sb.deleterootdir';
        $uriData = [
            'location' => $location
        ];

        try {
            $response = $this->_request(
                [
                    'uri' => $uri,
                    'type' => 'get',
                    'data' => $uriData
                ]
            );
        } catch (\Exception $e) {
            throw new InvalidException($e->getMessage());
        }

        return $response->getBody()->getContents();
    }
531021
public function matchLocation(Location $location)
    {
        $contentType = $this->repository
            ->getContentTypeService()
            ->loadContentType($location->getContentInfo()->contentTypeId);

        return isset($this->values[$contentType->identifier]);
    }
839051
public function redirectToLocation(Location $location, string $uriFragment = ''): RedirectResponse
    {
        return $this->redirectToRoute('_ezpublishLocation', [
            'locationId' => $location->id,
            '_fragment' => $uriFragment,
        ]);
    }