diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2018-06-07 14:40:12 +0200 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2018-07-02 11:29:29 +0200 |
commit | 957b27f28267fd95bec9c8a041ca1e7be9d32aa6 (patch) | |
tree | 3b246af7f382572f53624e7afe32bd237da01a09 /apps/federatedfilesharing/lib/ocm | |
parent | 61485e3e600d5a9359ac215602c4778f00d38823 (diff) | |
download | nextcloud-server-957b27f28267fd95bec9c8a041ca1e7be9d32aa6.tar.gz nextcloud-server-957b27f28267fd95bec9c8a041ca1e7be9d32aa6.zip |
replace \OCP\Federation\Exception\ShareNotFoundException with the generic \OCP\Share\Exception\ShareNotFound exception
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/federatedfilesharing/lib/ocm')
-rw-r--r-- | apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php b/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php index ae2e12bb894..422d008ffd6 100644 --- a/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php +++ b/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php @@ -21,21 +21,18 @@ namespace OCA\FederatedFileSharing\OCM; -use function GuzzleHttp\default_ca_bundle; use OC\AppFramework\Http; use OC\Files\Filesystem; use OCA\Files_Sharing\Activity\Providers\RemoteShares; use OCA\FederatedFileSharing\AddressHandler; use OCA\FederatedFileSharing\FederatedShareProvider; use OCP\Activity\IManager as IActivityManager; -use OCP\Activity\IManager; use OCP\App\IAppManager; use OCP\Constants; use OCP\Federation\Exceptions\ActionNotSupportedException; use OCP\Federation\Exceptions\AuthenticationFailedException; use OCP\Federation\Exceptions\BadRequestException; use OCP\Federation\Exceptions\ProviderCouldNotAddShareException; -use OCP\Federation\Exceptions\ShareNotFoundException; use OCP\Federation\ICloudFederationFactory; use OCP\Federation\ICloudFederationProvider; use OCP\Federation\ICloudFederationProviderManager; @@ -272,7 +269,6 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { * @throws ActionNotSupportedException * @throws AuthenticationFailedException * @throws BadRequestException - * @throws ShareNotFoundException * @throws \OC\HintException * @since 14.0.0 */ @@ -306,7 +302,6 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { * @throws ActionNotSupportedException * @throws AuthenticationFailedException * @throws BadRequestException - * @throws ShareNotFoundException * @throws \OC\HintException */ private function shareAccepted($id, $notification) { @@ -348,14 +343,14 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { /** * @param IShare $share - * @throws ShareNotFoundException + * @throws ShareNotFound */ protected function executeAcceptShare(IShare $share) { try { $fileId = (int)$share->getNode()->getId(); list($file, $link) = $this->getFile($this->getCorrectUid($share), $fileId); } catch (\Exception $e) { - throw new ShareNotFoundException(); + throw new ShareNotFound(); } $event = $this->activityManager->generateEvent(); @@ -378,7 +373,6 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { * @throws AuthenticationFailedException * @throws BadRequestException * @throws ShareNotFound - * @throws ShareNotFoundException * @throws \OC\HintException * */ @@ -425,7 +419,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { * delete declined share and create a activity * * @param IShare $share - * @throws ShareNotFoundException + * @throws ShareNotFound */ protected function executeDeclineShare(IShare $share) { $this->federatedShareProvider->removeShareFromTable($share); @@ -434,7 +428,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { $fileId = (int)$share->getNode()->getId(); list($file, $link) = $this->getFile($this->getCorrectUid($share), $fileId); } catch (\Exception $e) { - throw new ShareNotFoundException(); + throw new ShareNotFound(); } $event = $this->activityManager->generateEvent(); @@ -456,7 +450,6 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { * @return array * @throws AuthenticationFailedException * @throws BadRequestException - * @throws ShareNotFoundException */ private function undoReshare($id, $notification) { if (!isset($notification['sharedSecret'])) { @@ -471,7 +464,16 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { return []; } - private function unshare($id, $notification) { + /** + * unshare file from self + * + * @param string $id + * @param array $notification + * @return array + * @throws ActionNotSupportedException + * @throws BadRequestException + */ + private function unshare($id, array $notification) { if (!$this->isS2SEnabled(true)) { throw new ActionNotSupportedException("incoming shares disabled!"); @@ -554,7 +556,6 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { * @throws AuthenticationFailedException * @throws BadRequestException * @throws ProviderCouldNotAddShareException - * @throws ShareNotFoundException * @throws ShareNotFound */ protected function reshareRequested($id, $notification) { @@ -613,7 +614,6 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { * @return array * @throws AuthenticationFailedException * @throws BadRequestException - * @throws ShareNotFoundException */ protected function updateResharePermissions($id, $notification) { |