diff options
author | Piotr Filiciak <piotr@filiciak.pl> | 2016-05-25 16:38:48 +0300 |
---|---|---|
committer | Piotr Filiciak <piotr@filiciak.pl> | 2016-05-25 16:38:48 +0300 |
commit | 002a7f829461350a33496cd3a78b4e611d5d2727 (patch) | |
tree | 6eb8fd0dc347959b8ea4bdaa4d4237c8ff69479b /lib | |
parent | 8c439643a168ff2214974c4834dc3894553fa403 (diff) |
replaced UnseekableException => NotPermittedException
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files.php | 4 | ||||
-rw-r--r-- | lib/private/files/view.php | 6 | ||||
-rw-r--r-- | lib/public/files/unseekableexception.php | 35 |
3 files changed, 5 insertions, 40 deletions
diff --git a/lib/private/files.php b/lib/private/files.php index ad5ba6d94ae..639fd30b554 100644 --- a/lib/private/files.php +++ b/lib/private/files.php @@ -275,7 +275,7 @@ class OC_Files { $view->readfilePart($filename, $rangeArray[0]['from'], $rangeArray[0]['to']); } else { - // check if file is seekable (if not throw UnseekableException) + // check if file is seekable (if not throw NotPermittedException) // we have to check it before body contents $view->readfilePart($filename, $rangeArray[0]['size'], $rangeArray[0]['size']); @@ -289,7 +289,7 @@ class OC_Files { } echo "\r\n--".self::getBoundary()."--\r\n"; } - } catch (\OCP\Files\UnseekableException $ex) { + } catch (\OCP\Files\NotPermittedException $ex) { // file is unseekable header_remove('Accept-Ranges'); header_remove('Content-Range'); diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 66562064ebe..bf49ea2148d 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -53,7 +53,7 @@ use OCP\Files\InvalidCharacterInPathException; use OCP\Files\InvalidPathException; use OCP\Files\NotFoundException; use OCP\Files\ReservedWordException; -use OCP\Files\UnseekableException; +use OCP\Files\NotPermittedException; use OCP\Files\Storage\ILockingStorage; use OCP\IUser; use OCP\Lock\ILockingProvider; @@ -430,7 +430,7 @@ class View { * @param int $to * @return bool|mixed * @throws \OCP\Files\InvalidPathException - * @throws \OCP\Files\UnseekableException + * @throws \OCP\Files\NotPermittedException */ public function readfilePart($path, $from, $to) { $this->assertPathLength($path); @@ -452,7 +452,7 @@ class View { return $size; } - throw new \OCP\Files\UnseekableException('fseek error'); + throw new \OCP\Files\NotPermittedException('fseek error'); } return false; } diff --git a/lib/public/files/unseekableexception.php b/lib/public/files/unseekableexception.php deleted file mode 100644 index b59f844ce2f..00000000000 --- a/lib/public/files/unseekableexception.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Piotr Filiciak <piotr@filiciak.pl> - * - * @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/> - * - */ - -/** - * Public interface of ownCloud for apps to use. - * Files/UnseekableException class - */ - -// use OCP namespace for all classes that are considered public. -// This means that they should be used by apps instead of the internal ownCloud classes -namespace OCP\Files; - -/** - * Exception for seek problem - * @since 9.1.0 - */ -class UnseekableException extends \Exception {} |