, * protocols: array * }>, * }, * } * @throws OCMArgumentException */ public function getCapabilities() { $url = $this->urlGenerator->linkToRouteAbsolute('cloud_federation_api.requesthandlercontroller.addShare'); $this->provider->setEnabled(true); $this->provider->setApiVersion(self::API_VERSION); $pos = strrpos($url, '/'); if ($pos === false) { throw new OCMArgumentException('generated route should contains a slash character'); } $this->provider->setEndPoint(substr($url, 0, $pos)); $resource = $this->provider->createNewResourceType(); $resource->setName('file') ->setShareTypes(['user', 'group']) ->setProtocols(['webdav' => '/public.php/webdav/']); $this->provider->addResourceType($resource); return ['ocm' => $this->provider->jsonSerialize()]; } }