Check and construct an real URL to make request

@param $resource
@return string
331614
public function makeUrl($resource)
    {
        $host     = trim(str_replace(['http://', 'https://'], null, $this->host), '/');
        $resource = trim($resource, '/');
        //Create URI
        $uri = $host . ':' . $this->port . '/' . $resource;

        return $uri;
    }
1242651
protected function getFilename(Resource $resource)
    {
        return sprintf(
            '%s/%s%s',
            $this->dir,
            md5(serialize($resource)),
            $this->suffix
        );
    }
1024034
public static function createFromResource($resource): Stream
    {
        if (!\is_resource($resource))
        {
            throw new \InvalidArgumentException('Stream must be a resource');
        }

        $obj           = new self();
        $obj->stream   = $resource;
        $meta          = stream_get_meta_data($obj->stream);
        $obj->seekable = $meta['seekable'];
        $obj->readable = isset(self::$readWriteHash['read'][$meta['mode']]);
        $obj->writable = isset(self::$readWriteHash['write'][$meta['mode']]);
        $obj->uri      = $obj->getMetadata('uri');

        return $obj;
    }
1230022
public function getRedirectParameters($resource = null)
    {
        $redirect = $this->parameters->get('redirect');

        if ($this->areParametersIntentionallyEmptyArray($redirect)) {
            return [];
        }

        if (!is_array($redirect)) {
            $redirect = ['parameters' => []];
        }

        $parameters = $redirect['parameters'] ?? [];
        $parameters = $this->addExtraRedirectParameters($parameters);

        if (null !== $resource) {
            $parameters = $this->parseResourceValues($parameters, $resource);
        }

        return $parameters;
    }
1126791
public function formClass($resource=null)
    {

        $resource = $this->passedOrCurrent($resource);

        if ($formClass = $this->mapper->formClass($resource)) {
            return $formClass;
        }

        $modelClass = class_basename($this->modelClass($resource));

        if ($formClass = $this->finder->formClass($resource, $modelClass)) {
            return $formClass;
        }

        return '';
    }
633345
public function getForResource($resource)
    {
        $resourceName = $this->resourceName($resource);

        if (isset($this->resourceFactories[$resourceName])) {
            return $this->resourceFactories[$resourceName];
        }

        throw new HandlerNotFoundException("No handler found for resource '$resourceName'");

    }
1178469
public function shallow(self $resource)
    {
        $newResource = new self;
        $resource->forget();
        $routes = $resource->all();

        foreach ($routes as $route) {
            if (strpos("index make create", $route->getAction()[1]) !== false) {
                $newResource->set($route);
            }
        }

        return $this->nest($newResource);
    }
17436
public function buildUrlString($baseUrl, $resource)
    {
        if (null === $baseUrl || '' == $baseUrl) {
            return null;
        }

        if (null === $resource || '' == $resource) {
            return $baseUrl;
        }

        $baseUrl = $this->removeTrainingSlash($baseUrl);
        if (!substr($resource, 0, 1) == '/') {
            $resource = '/' . $resource;
        }

        return $baseUrl . $resource;
    }
1300762
public static function getTransformerFromResource($resource)
    {
        if (! in_array($resource, static::getResources())) {
            return '';
        }

        $resourceName = studly_case(str_singular($resource));

        return 'App\Transformers\\'.$resourceName.'s\\'.$resourceName.'Transformer';   
    }
482224
protected function sendGetRequest($resource, $params = [])
    {
        $response = $this->sendRequest(
            'GET',
            $this->getServiceUrl($resource, $params),
            [
                'headers' => [
                    'Accept' => 'application/x-yametrika+json',
                    'Content-Type' => 'application/x-yametrika+json',
                    'Authorization' => 'OAuth ' . $this->getAccessToken(),
                ]
            ]
        );

        $decodedResponseBody = $this->getDecodedBody($response->getBody());

        if (isset($decodedResponseBody['links']) && isset($decodedResponseBody['links']['next'])) {
            $url = $decodedResponseBody['links']['next'];
            unset($decodedResponseBody['rows']);
            unset($decodedResponseBody['links']);
            return $this->getNextPartOfList($url, $decodedResponseBody);
        }
        return $decodedResponseBody;
    }
665125
public static String getResourceURL(String resource) {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        return cl.getResource(resource).toString();
    }
876376
public function resolvePath($resource)
    {
        // Skip blank resources
        if (empty($resource)) {
            return null;
        }
        $resourceObj = $this->resolveResource($resource);
        if ($resourceObj instanceof ModuleResource) {
            return $resourceObj->getRelativePath();
        }
        return $resource;
    }
276211
public function constructUrl(Request $request, Nette\Http\Url $url): ?string
	{
		if ($this->presenter != $request->getPresenterName()) {
			return null;
		}

		$base_url = $url->getBaseUrl();

		$action = $request->getParameter('action');
		$parameters = $request->getParameters();
		unset($parameters['action']);
		$path = ltrim($this->getPath(), '/');

		if (array_search($action, $this->actions, true) === false) {
			return null;
		}

		foreach ($parameters as $name => $value) {
			if (strpos($path, "<{$name}>") !== false && $value !== null) {
				$path = str_replace("<{$name}>", $value, $path);

				unset($parameters[$name]);
			}
		}

		$path = preg_replace_callback('/\[.+?\]/', function ($item) {
			if (strpos(end($item), '<')) {
				return '';
			}

			return end($item);
		}, $path);

		/**
		 * There are still some required parameters in url mask
		 */
		if (preg_match('/<\w+>/', $path)) {
			return null;
		}

		$path = str_replace(['[', ']'], '', $path);

		$query = http_build_query($parameters);

		return $base_url . $path . ($query ? '?' . $query : '');
	}
654612
protected static function isKeyResource($resource): bool {
        if(!is_resource($resource)) {
            return FALSE;
        }
        if(get_resource_type($resource) != 'OpenSSL key') {
            return FALSE;
        }
        return TRUE;
    }
105367
private function completePath(string $resource): string
    {
        if (substr($resource, 0, strlen((string) $this->rootpath)) == $this->rootpath) {
            return $resource;
        }

        return $this->rootpath
                . DIRECTORY_SEPARATOR . 'src'
                . DIRECTORY_SEPARATOR . 'main'
                . DIRECTORY_SEPARATOR . 'resources'
                . DIRECTORY_SEPARATOR . $resource;
    }
479980
public function searchForm($resource=null)
    {

        $resource = $this->passedOrCurrent($resource);

        if (!$formClass = $this->searchFormClass($resource)) {
            return '';
        }

        return $this->makeSearchForm($resource, $formClass);

    }
685400
public function refresh( $resource )
    {
        $url = $url = '/' . $resource . '/' . $this->id;

        $requestor = new ApiRequestor();
        $response = $requestor->request(
            'get',
            $url,
            $this->_retrieveOptions
        );
        $this->refreshFrom($response[0]);

        return $this;
    }