public function get_link($url) {
        $ocsparams = [
            'path' => $url,
            'shareType' => ocs_client::SHARE_TYPE_PUBLIC,
            'publicUpload' => false,
            'permissions' => ocs_client::SHARE_PERMISSION_READ
            ];

        $response = $this->ocsclient->call('create_share', $ocsparams);
        $xml = simplexml_load_string($response);

        if ($xml === false ) {
            throw new \repository_nextcloud\request_exception(array('instance' => $this->get_name(),
                'errormessage' => get_string('invalidresponse', 'repository_nextcloud')));
        }

        if ((string)$xml->meta->status !== 'ok') {
            throw new \repository_nextcloud\request_exception(array('instance' => $this->get_name(), 'errormessage' => sprintf(
                '(%s) %s', $xml->meta->statuscode, $xml->meta->message)));
        }

        // Take the share link and convert it into a download link.
        return ((string)$xml->data[0]->url) . '/download';
    }