Пример #1
0
 /**
  * Get the share by token possible with password
  *
  * @param string $token
  * @return Share
  *
  * @throws ShareNotFound
  */
 public function getShareByToken($token)
 {
     $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_LINK);
     $share = $provider->getShareByToken($token);
     //TODO check if share expired
     return $share;
 }
Пример #2
0
 /**
  * Retrieve a share by the share id
  *
  * @param string $id
  * @return Share
  *
  * @throws ShareNotFound
  */
 public function getShareById($id)
 {
     if ($id === null) {
         throw new ShareNotFound();
     }
     list($providerId, $id) = $this->splitFullId($id);
     $provider = $this->factory->getProvider($providerId);
     $share = $provider->getShareById($id);
     $share->setProviderId($provider->identifier());
     return $share;
 }