// First check if it is an internal share.
try {
$share = $this->shareManager->getShareById('ocinternal:'.$id);
- } catch (\OC\Share20\Exception\ShareNotFound $e) {
+ } catch (\OCP\Share\Exceptions\ShareNotFound $e) {
// Ignore for now
//return new \OC_OCS_Result(null, 404, 'wrong share ID, share doesn\'t exist.');
}
try {
$share = $this->shareManager->getShareById('ocinternal:' . $id);
- } catch (\OC\Share20\Exception\ShareNotFound $e) {
+ } catch (\OCP\Share\Exceptions\ShareNotFound $e) {
//Ignore for now
//return new \OC_OCS_Result(null, 404, 'wrong share ID, share doesn\'t exist.');
}
try {
$share = $this->shareManager->getShareById('ocinternal:' . $id);
- } catch (\OC\Share20\Exception\ShareNotFound $e) {
+ } catch (\OCP\Share\Exceptions\ShareNotFound $e) {
//Ignore for now
//return new \OC_OCS_Result(null, 404, 'wrong share ID, share doesn\'t exist.');
}
use OCA\Files_Sharing\Activity;
use \OCP\Files\NotFoundException;
use OCP\Files\IRootFolder;
+use OCP\Share\Exceptions\ShareNotFound;
/**
* Class ShareController
// Check whether share exists
try {
$share = $this->shareManager->getShareByToken($token);
- } catch (\OC\Share20\Exception\ShareNotFound $e) {
+ } catch (ShareNotFound $e) {
return new NotFoundResponse();
}
// Check whether share exists
try {
$share = $this->shareManager->getShareByToken($token);
- } catch (\OC\Share20\Exception\ShareNotFound $e) {
+ } catch (ShareNotFound $e) {
return new NotFoundResponse();
}
->expects($this->once())
->method('getShareById')
->with('ocinternal:42')
- ->will($this->throwException(new \OC\Share20\Exception\ShareNotFound()));
+ ->will($this->throwException(new \OCP\Share\Exceptions\ShareNotFound()));
$expected = new \OC_OCS_Result(null, 404, 'wrong share ID, share doesn\'t exist.');
$this->assertEquals($expected, $this->ocs->deleteShare(42));
namespace OCA\Files_Sharing\Controllers;
use OC\Files\Filesystem;
-use OC\Share20\Exception\ShareNotFound;
+use OCP\Share\Exceptions\ShareNotFound;
use OCP\AppFramework\Http\NotFoundResponse;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http\TemplateResponse;
->expects($this->once())
->method('getShareByToken')
->with('token')
- ->will($this->throwException(new \OC\Share20\Exception\ShareNotFound()));
+ ->will($this->throwException(new \OCP\Share\Exceptions\ShareNotFound()));
$response = $this->shareController->authenticate('token');
$expectedResponse = new NotFoundResponse();
use OCP\Share\IShareProvider;
use OC\Share20\Exception\InvalidShare;
use OC\Share20\Exception\ProviderException;
-use OC\Share20\Exception\ShareNotFound;
+use OCP\Share\Exceptions\ShareNotFound;
use OC\Share20\Exception\BackendError;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Files\NotFoundException;
+++ /dev/null
-<?php
-/**
- * @author Roeland Jago Douma <rullzer@owncloud.com>
- *
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-namespace OC\Share20\Exception;
-
-class ShareNotFound extends \Exception {
-
-}
use OCP\Files\Folder;
use OCP\IUser;
-use OC\Share20\Exception\ShareNotFound;
+use OCP\Share\Exceptions\ShareNotFound;
use OC\HintException;
/**
--- /dev/null
+<?php
+
+namespace OCP\Share\Exceptions;
+use OC\HintException;
+
+/**
+ * Class GenericEncryptionException
+ *
+ * @package OCP\Share\Exceptions
+ * @since 9.0.0
+ */
+class GenericShareException extends HintException {
+
+ /**
+ * @param string $message
+ * @param string $hint
+ * @param int $code
+ * @param \Exception $previous
+ * @since 9.0.0
+ */
+ public function __construct($message = '', $hint = '', $code = 0, \Exception $previous = null) {
+ if (empty($message)) {
+ $message = 'Unspecified share exception';
+ }
+ parent::__construct($message, $hint, $code, $previous);
+ }
+
+}
--- /dev/null
+<?php
+/**
+ * @author Roeland Jago Douma <rullzer@owncloud.com>
+ *
+ * @copyright Copyright (c) 2016, ownCloud, Inc.
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+namespace OCP\Share\Exceptions;
+
+/**
+ * Class ShareNotFound
+ *
+ * @package OCP\Share\Exceptions
+ * @since 9.0.0
+ */
+class ShareNotFound extends GenericShareException {
+
+}
/**
- * @expectedException \OC\Share20\Exception\ShareNotFound
+ * @expectedException \OCP\Share\Exceptions\ShareNotFound
*/
public function testGetShareByIdNotExist() {
$this->provider->getShareById(1);
}
/**
- * @expectedException \OC\Share20\Exception\ShareNotFound
+ * @expectedException \OCP\Share\Exceptions\ShareNotFound
*/
public function testGetShareByTokenNotFound() {
$this->provider->getShareByToken('invalidtoken');
}
/**
- * @expectedException \OC\Share20\Exception\ShareNotFound
+ * @expectedException \OCP\Share\Exceptions\ShareNotFound
*/
public function testDeleteNoShareId() {
$share = $this->getMock('\OCP\Share\IShare');