Exemple #1
0
 /**
  * @inheritdoc
  */
 public function getShareById($id, $recipient = null)
 {
     if ($id === null) {
         throw new ShareNotFound();
     }
     list($providerId, $id) = $this->splitFullId($id);
     $provider = $this->factory->getProvider($providerId);
     $share = $provider->getShareById($id, $recipient);
     return $share;
 }
Exemple #2
0
 /**
  * @inheritdoc
  */
 public function getShareById($id, $recipient = null)
 {
     if ($id === null) {
         throw new ShareNotFound();
     }
     list($providerId, $id) = $this->splitFullId($id);
     $provider = $this->factory->getProvider($providerId);
     $share = $provider->getShareById($id, $recipient);
     // Validate link shares expiration date
     if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK && $share->getExpirationDate() !== null && $share->getExpirationDate() <= new \DateTime()) {
         $this->deleteShare($share);
         throw new ShareNotFound();
     }
     return $share;
 }