private function createResourceLocatorUrl($scheme, $portalUrl, $resourceLocator)
    {
        if (false !== strpos($portalUrl, '/')) {
            // trim slash when resourceLocator is not domain root
            $resourceLocator = rtrim($resourceLocator, '/');
        }

        return rtrim(sprintf('%s://%s', $scheme, $portalUrl), '/') . $resourceLocator;
    }