Find the URLs given one of them.
@param $uri
The Drupal or Fedora URI.
@param null $token
Authorization token.

@return null|string[]
541657
public function findByUri(
        $uri,
        $token = null
    ) {
        $headers['X-Islandora-URI'] = $uri;

        if (!empty($token)) {
            $headers["Authorization"] = $token;
        }

        try {
            $response = $this->client->get('by_uri', [
            'headers' => $headers,
            ]);
        } catch (ClientException $e) {
            // Got a 404
            $this->log->debug('Gemini findByURI 404 response', [
            'uri' => $uri,
            ]);
            return null;
        }

        $this->log->debug("Gemini findByURI response", [
        'uri' => $uri,
        'response' => $response,
        ]);

        return $response->getHeader('Location');
    }
284519
protected function processUri($uri)
    {
        return preg_replace_callback('#\{([a-zA-Z0-9_,]*)\}#i', function ($matches) {
            return isset($this->tokens[$matches[1]]) ? $this->tokens[$matches[1]] : '';
        }, $uri);
    }
956572
public function getAuthorizeUrl($request_token, $callback_uri = NULL, $state = NULL) {
    if (empty($callback_uri) && isset($request_token['callback_uri'])) {
      $callback_uri = $request_token['callback_uri'];
    }
    if (empty($state)) {
      $state = md5(mt_rand());
    }
    $params = array();
    if ($this->getConfig()->get('offline_access')) {
      $params += $this->getOfflineAccessParams();
    }

    $query = array(
      'response_type' => 'code',
      'client_id' => $this->getConfig('consumer_key'),
      'redirect_uri' => $callback_uri,
      'scope' => implode($this->getConfig('scope_delimiter'), $this->getScope()),
      'state' => $state,
    ) + $params;
    // authorize
    $url = Url::factory($this->getConfig('base_url'));
    $url->addPath($this->getConfig('authorize_path'));
    $url->setQuery($query);
    return (string)$url;
  }
729383
public String redirectUrl(String token) {
        return play.shaded.oauth.oauth.signpost.OAuth.addQueryParameters(
                provider.getAuthorizationWebsiteUrl(),
                play.shaded.oauth.oauth.signpost.OAuth.OAUTH_TOKEN,
                token
        );
    }
538251
public static function findByPasswordResetToken(string $token) : ?self
    {
        if (!static::isPasswordResetTokenValid($token)) {
            return null;
        }
        return static::findOne([
            'password_reset_token' => $token,
            'status' => self::STATUS_ACTIVE,
        ]);
    }
122932
public static function detect($uri)
    {
        $routes = self::get();
        $found = false;
        foreach($routes as $key => $route) {
            $currentLength = strlen($route->route);
            if(substr($uri, 0, $currentLength) == $route->route) {
                $found = $route;
                break;
            }
        }
        
        return $found;
    }
696380
public function parseURI(string $uri) : array
    {
        if ($uri == '') {
            throw new \InvalidArgumentException(
                "URI Could not be empty"
            );
        }

        $parsedUri = parse_url($uri);
        if ($parsedUri === false) {
            throw new \InvalidArgumentException("Unable to parse URI: $uri");
        }

        $defaultParsedUri = [
            'user'  => null,
            'pass'  => null,
            'scheme'=> '',
            'host'  => '',
            'port'  => null,
            'path'  => '',
            'query' => '',
            'fragment' => '',
        ];

        return array_merge($defaultParsedUri, $parsedUri);
    }
567602
public function getAuthorizeUrl($request_token, $callback_uri = NULL, $state = NULL) {
    $request_token = array(
      'oauth_token' => is_array($request_token) ? $request_token['oauth_token'] : $request_token,
    );
    // authorize
    $url = Url::factory($this->getConfig('base_url'));
    $url->addPath($this->getConfig('authorize_path'));
    $url->setQuery($request_token);
    return (string)$url;
  }
1235420
public function createUrlFromUri($uri)
    {
        $uri = ltrim($uri, '/');

        return empty($this->baseUrl)
            ? $this->app[\Illuminate\Contracts\Routing\UrlGenerator::class]->to($uri)
            : $this->baseUrl.$uri;
    }
356998
public function findTokenDirectories(string $token) : array
    {
        $tokenFinder = $this->finderFactory->build();
        $tokenFinder->in($this->environment->getRootDirectory())->files()->name($token);
        $rawExcludePathsByToken = $this->finderToRealPathConverter
            ->finderToArrayOfPaths($tokenFinder);
        return array_map('dirname', $rawExcludePathsByToken);
    }
719861
public function findByActivationToken($token)
    {
        $userMeta = $this->userMeta->where('activation_token', $token)->first();

        if ($userMeta) {
            return $userMeta->user()->first();
        }

        return false;
    }
612394
public static function parseUri(string $uri){
        if(1 !== preg_match(static::REGEX_URI, $uri, $m)){
            return false;
        }

        $result = [
            "scheme"    => $m["scheme"] ?? "",
            "userinfo"  => $m["userinfo"] ?? "",
            "host"      => $m["host"] ?? "",
            "port"      => "" === $m["port"] ? null : (int)$m["port"],
            "path"      => $m["path"] ?? "",
            "query"     => $m["query"] ?? "",
            "fragment"  => $m["fragment"] ?? "",
        ];

        return $result;
    }
958741
protected function extractOptionalParameters($uri)
    {
        preg_match_all('/\{(\w+?)\?\}/', $uri, $matches);

        return isset($matches[1]) ? array_fill_keys($matches[1], null) : array();
    }
706799
protected function queryJson( $uri )
    {
        $response = $this->getHttpClient( $uri )
                         ->send();

        if ( $response->isOk() )
        {
            $headers = $response->getHeaders();

            if ( $headers->has( 'Content-Type' ) &&
                 preg_match( '#^(application|text)/(.*\+)?json(\s*;.*)?$#',
                             $headers->get( 'Content-Type' )->getFieldValue() ) )
            {
                return Json::decode( $response->getBody(), Json::TYPE_ARRAY );
            }
        }

        return null;
    }
642312
function requestURI( $uri )
    {
        $parsed = parse_url( $uri );

        $return = '';
        if ( isset( $parsed['user'] ) )
        {
            $return .= $parsed['user'] . '@' . $parsed['pass'];
        }
        $params = ( $this->Verb == 'GET' || $this->Verb == 'HEAD' || $this->Verb == 'TRACE' ) ? $this->Parameters : array();
        if ( $this->NameVar == null )
        {
            $return .= rtrim( $parsed['path'], '/' ) . '/' . ltrim( $this->Name, '/' );
        }
        else
        {
            $return .= $parsed['path'];
            if ( $this->Verb == 'GET' || $this->Verb == 'HEAD' )
            {
                $params[$this->NameVar] = $this->Name;
            }
        }

        if ( isset( $parsed['query'] ) )
        {
            $return  .= '?' . $parsed['query'];
            $next = '&';
        }
        else
        {
            $next = '?';
        }
        if ( count( $params ) )
        {
            $return .= $next . $this->_payload( $params );
        }
        if ( isset( $parsed['fragment'] ) )
        {
            $return .= '#' . $parsed['fragment'];
        }

        return $return;
    }
795490
public function getHTTPMethods($uri) {
		$path = $this->pathHelper->getPathFromUri($uri);
		if ($this->searchBackend->getArbiterPath() === $path) {
			return ['SEARCH'];
		} else {
			return [];
		}
	}
1004637
protected function _get($token = null)
    {
        $token = $this->_token($token);

        $subject = $this->_subject([
            'success' => true,
            'entity' => $this->_table()->newEntity(),
            'token' => $token
        ]);

        $this->_trigger('beforeRender', $subject);
    }