diff --git a/lib/files/node/file.php b/lib/files/node/file.php index f13b474aa6ca925d5e2b517d20cf535e3ba73e6f..75d5e0166b638139d962f1056af8b6a9f7802772 100644 --- a/lib/files/node/file.php +++ b/lib/files/node/file.php @@ -8,12 +8,12 @@ namespace OC\Files\Node; -use OC\Files\NotPermittedException; +use OCP\Files\NotPermittedException; -class File extends Node implements \OCP\Files\Node\File { +class File extends Node implements \OCP\Files\File { /** * @return string - * @throws \OC\Files\NotPermittedException + * @throws \OCP\Files\NotPermittedException */ public function getContent() { if ($this->checkPermissions(\OCP\PERMISSION_READ)) { @@ -28,7 +28,7 @@ class File extends Node implements \OCP\Files\Node\File { /** * @param string $data - * @throws \OC\Files\NotPermittedException + * @throws \OCP\Files\NotPermittedException */ public function putContent($data) { if ($this->checkPermissions(\OCP\PERMISSION_UPDATE)) { @@ -50,7 +50,7 @@ class File extends Node implements \OCP\Files\Node\File { /** * @param string $mode * @return resource - * @throws \OC\Files\NotPermittedException + * @throws \OCP\Files\NotPermittedException */ public function fopen($mode) { $preHooks = array(); @@ -101,7 +101,7 @@ class File extends Node implements \OCP\Files\Node\File { /** * @param string $targetPath - * @throws \OC\Files\NotPermittedException + * @throws \OCP\Files\NotPermittedException * @return \OC\Files\Node\Node */ public function copy($targetPath) { @@ -123,7 +123,7 @@ class File extends Node implements \OCP\Files\Node\File { /** * @param string $targetPath - * @throws \OC\Files\NotPermittedException + * @throws \OCP\Files\NotPermittedException * @return \OC\Files\Node\Node */ public function move($targetPath) { diff --git a/lib/files/node/folder.php b/lib/files/node/folder.php index daf75d7c23ef09b39698740eff399c152e782230..923f53821b2b2fea687e56d0c358237072cbce65 100644 --- a/lib/files/node/folder.php +++ b/lib/files/node/folder.php @@ -10,14 +10,14 @@ namespace OC\Files\Node; use OC\Files\Cache\Cache; use OC\Files\Cache\Scanner; -use OC\Files\NotFoundException; -use OC\Files\NotPermittedException; +use OCP\Files\NotFoundException; +use OCP\Files\NotPermittedException; -class Folder extends Node implements \OCP\Files\Node\Folder { +class Folder extends Node implements \OCP\Files\Folder { /** * @param string $path path relative to the folder * @return string - * @throws \OC\Files\NotPermittedException + * @throws \OCP\Files\NotPermittedException */ public function getFullPath($path) { if (!$this->isValidPath($path)) { @@ -28,7 +28,7 @@ class Folder extends Node implements \OCP\Files\Node\Folder { /** * @param string $path - * @throws \OC\Files\NotFoundException + * @throws \OCP\Files\NotFoundException * @return string */ public function getRelativePath($path) { @@ -60,7 +60,7 @@ class Folder extends Node implements \OCP\Files\Node\Folder { /** * get the content of this directory * - * @throws \OC\Files\NotFoundException + * @throws \OCP\Files\NotFoundException * @return Node[] */ public function getDirectoryListing() { @@ -164,7 +164,7 @@ class Folder extends Node implements \OCP\Files\Node\Folder { * * @param string $path * @return \OC\Files\Node\Node - * @throws \OC\Files\NotFoundException + * @throws \OCP\Files\NotFoundException */ public function get($path) { return $this->root->get($this->getFullPath($path)); @@ -185,8 +185,8 @@ class Folder extends Node implements \OCP\Files\Node\Folder { /** * @param string $path - * @return Folder - * @throws NotPermittedException + * @return \OC\Files\Node\Folder + * @throws \OCP\Files\NotPermittedException */ public function newFolder($path) { if ($this->checkPermissions(\OCP\PERMISSION_CREATE)) { @@ -206,8 +206,8 @@ class Folder extends Node implements \OCP\Files\Node\Folder { /** * @param string $path - * @return File - * @throws NotPermittedException + * @return \OC\Files\Node\File + * @throws \OCP\Files\NotPermittedException */ public function newFile($path) { if ($this->checkPermissions(\OCP\PERMISSION_CREATE)) { @@ -229,7 +229,7 @@ class Folder extends Node implements \OCP\Files\Node\Folder { * search for files with the name matching $query * * @param string $query - * @return Node[] + * @return \OC\Files\Node\Node[] */ public function search($query) { return $this->searchCommon('%' . $query . '%', 'search'); @@ -248,7 +248,7 @@ class Folder extends Node implements \OCP\Files\Node\Folder { /** * @param string $query * @param string $method - * @return Node[] + * @return \OC\Files\Node\Node[] */ private function searchCommon($query, $method) { $files = array(); @@ -298,7 +298,7 @@ class Folder extends Node implements \OCP\Files\Node\Folder { /** * @param $id - * @return Node[] + * @return \OC\Files\Node\Node[] */ public function getById($id) { $nodes = $this->root->getById($id); @@ -337,7 +337,7 @@ class Folder extends Node implements \OCP\Files\Node\Folder { /** * @param string $targetPath - * @throws \OC\Files\NotPermittedException + * @throws \OCP\Files\NotPermittedException * @return \OC\Files\Node\Node */ public function copy($targetPath) { @@ -359,7 +359,7 @@ class Folder extends Node implements \OCP\Files\Node\Folder { /** * @param string $targetPath - * @throws \OC\Files\NotPermittedException + * @throws \OCP\Files\NotPermittedException * @return \OC\Files\Node\Node */ public function move($targetPath) { diff --git a/lib/files/node/node.php b/lib/files/node/node.php index 5ee9f23161f654f4ed8ca51ce3dda9c39768775f..063e2424a64d351e358ef30b789e0bfe73ed79df 100644 --- a/lib/files/node/node.php +++ b/lib/files/node/node.php @@ -10,12 +10,10 @@ namespace OC\Files\Node; use OC\Files\Cache\Cache; use OC\Files\Cache\Scanner; -use OC\Files\NotFoundException; -use OC\Files\NotPermittedException; +use OCP\Files\NotFoundException; +use OCP\Files\NotPermittedException; -require_once 'files/exceptions.php'; - -class Node implements \OCP\Files\Node\Node { +class Node implements \OCP\Files\Node { /** * @var \OC\Files\View $view */ @@ -61,7 +59,7 @@ class Node implements \OCP\Files\Node\Node { /** * @param string $targetPath - * @throws \OC\Files\NotPermittedException + * @throws \OCP\Files\NotPermittedException * @return \OC\Files\Node\Node */ public function move($targetPath) { @@ -82,7 +80,7 @@ class Node implements \OCP\Files\Node\Node { /** * @param int $mtime - * @throws \OC\Files\NotPermittedException + * @throws \OCP\Files\NotPermittedException */ public function touch($mtime = null) { if ($this->checkPermissions(\OCP\PERMISSION_UPDATE)) { @@ -96,7 +94,7 @@ class Node implements \OCP\Files\Node\Node { /** * @return \OC\Files\Storage\Storage - * @throws \OC\Files\NotFoundException + * @throws \OCP\Files\NotFoundException */ public function getStorage() { list($storage,) = $this->view->resolvePath($this->path); diff --git a/lib/files/node/nonexistingfile.php b/lib/files/node/nonexistingfile.php index 6f18450efee5f34b3069c210f3534a1ff0542a3d..d45076f7feee3940057304d245fc278228f196c7 100644 --- a/lib/files/node/nonexistingfile.php +++ b/lib/files/node/nonexistingfile.php @@ -8,12 +8,12 @@ namespace OC\Files\Node; -use OC\Files\NotFoundException; +use OCP\Files\NotFoundException; class NonExistingFile extends File { /** * @param string $newPath - * @throws \OC\Files\NotFoundException + * @throws \OCP\Files\NotFoundException */ public function rename($newPath) { throw new NotFoundException(); diff --git a/lib/files/node/nonexistingfolder.php b/lib/files/node/nonexistingfolder.php index 0249a026245ca77753b9c4b6f44a03d30ce74382..0346cbf1e2127456e345a49c8b09343e168a3e43 100644 --- a/lib/files/node/nonexistingfolder.php +++ b/lib/files/node/nonexistingfolder.php @@ -8,12 +8,12 @@ namespace OC\Files\Node; -use OC\Files\NotFoundException; +use OCP\Files\NotFoundException; class NonExistingFolder extends Folder { /** * @param string $newPath - * @throws \OC\Files\NotFoundException + * @throws \OCP\Files\NotFoundException */ public function rename($newPath) { throw new NotFoundException(); diff --git a/lib/files/node/root.php b/lib/files/node/root.php index f88d8c294c7499bedc2c6d39e4a248aa0eebead3..e3d58476e9ce68b4784b395a22345c17ac4d68a5 100644 --- a/lib/files/node/root.php +++ b/lib/files/node/root.php @@ -12,8 +12,8 @@ use OC\Files\Cache\Cache; use OC\Files\Cache\Scanner; use OC\Files\Mount\Manager; use OC\Files\Mount\Mount; -use OC\Files\NotFoundException; -use OC\Files\NotPermittedException; +use OCP\Files\NotFoundException; +use OCP\Files\NotPermittedException; use OC\Hooks\Emitter; use OC\Hooks\PublicEmitter; @@ -21,18 +21,18 @@ use OC\Hooks\PublicEmitter; * Class Root * * Hooks available in scope \OC\Files - * - preWrite(\OC\Files\Node\Node $node) - * - postWrite(\OC\Files\Node\Node $node) - * - preCreate(\OC\Files\Node\Node $node) - * - postCreate(\OC\Files\Node\Node $node) - * - preDelete(\OC\Files\Node\Node $node) - * - postDelete(\OC\Files\Node\Node $node) - * - preTouch(\OC\Files\Node\Node $node, int $mtime) - * - postTouch(\OC\Files\Node\Node $node) - * - preCopy(\OC\Files\Node\Node $source, \OC\Files\Node\Node $target) - * - postCopy(\OC\Files\Node\Node $source, \OC\Files\Node\Node $target) - * - preRename(\OC\Files\Node\Node $source, \OC\Files\Node\Node $target) - * - postRename(\OC\Files\Node\Node $source, \OC\Files\Node\Node $target) + * - preWrite(\OCP\Files\Node $node) + * - postWrite(\OCP\Files\Node $node) + * - preCreate(\OCP\Files\Node $node) + * - postCreate(\OCP\Files\Node $node) + * - preDelete(\OCP\Files\Node $node) + * - postDelete(\OCP\Files\Node $node) + * - preTouch(\OC\FilesP\Node $node, int $mtime) + * - postTouch(\OCP\Files\Node $node) + * - preCopy(\OCP\Files\Node $source, \OCP\Files\Node $target) + * - postCopy(\OCP\Files\Node $source, \OCP\Files\Node $target) + * - preRename(\OCP\Files\Node $source, \OCP\Files\Node $target) + * - postRename(\OCP\Files\Node $source, \OCP\Files\Node $target) * * @package OC\Files\Node */ @@ -152,8 +152,8 @@ class Root extends Folder implements Emitter { /** * @param string $path - * @throws \OC\Files\NotFoundException - * @throws \OC\Files\NotPermittedException + * @throws \OCP\Files\NotFoundException + * @throws \OCP\Files\NotPermittedException * @return Node */ public function get($path) { @@ -177,7 +177,7 @@ class Root extends Folder implements Emitter { * can exist in different places * * @param int $id - * @throws \OC\Files\NotFoundException + * @throws \OCP\Files\NotFoundException * @return Node[] */ public function getById($id) { @@ -200,7 +200,7 @@ class Root extends Folder implements Emitter { /** * @param string $targetPath - * @throws \OC\Files\NotPermittedException + * @throws \OCP\Files\NotPermittedException * @return \OC\Files\Node\Node */ public function rename($targetPath) { @@ -213,7 +213,7 @@ class Root extends Folder implements Emitter { /** * @param string $targetPath - * @throws \OC\Files\NotPermittedException + * @throws \OCP\Files\NotPermittedException * @return \OC\Files\Node\Node */ public function copy($targetPath) { @@ -222,7 +222,7 @@ class Root extends Folder implements Emitter { /** * @param int $mtime - * @throws \OC\Files\NotPermittedException + * @throws \OCP\Files\NotPermittedException */ public function touch($mtime = null) { throw new NotPermittedException(); @@ -230,7 +230,7 @@ class Root extends Folder implements Emitter { /** * @return \OC\Files\Storage\Storage - * @throws \OC\Files\NotFoundException + * @throws \OCP\Files\NotFoundException */ public function getStorage() { throw new NotFoundException(); @@ -322,7 +322,7 @@ class Root extends Folder implements Emitter { /** * @return Node - * @throws \OC\Files\NotFoundException + * @throws \OCP\Files\NotFoundException */ public function getParent() { throw new NotFoundException(); diff --git a/lib/public/files/alreadyexistsexception.php b/lib/public/files/alreadyexistsexception.php new file mode 100644 index 0000000000000000000000000000000000000000..32947c7a5c309614eee6dd9e9b2a0ee904e730a5 --- /dev/null +++ b/lib/public/files/alreadyexistsexception.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\Files; + +class AlreadyExistsException extends \Exception {} diff --git a/lib/public/files/notenoughspaceexception.php b/lib/public/files/notenoughspaceexception.php new file mode 100644 index 0000000000000000000000000000000000000000..e51806666ad139e2c3b9c3e91b1d3738c9fc7d0e --- /dev/null +++ b/lib/public/files/notenoughspaceexception.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\Files; + +class NotEnoughSpaceException extends \Exception {} diff --git a/lib/public/files/notfoundexception.php b/lib/public/files/notfoundexception.php new file mode 100644 index 0000000000000000000000000000000000000000..1ff426a40c6e405a0c5c9ffa812c747b230add73 --- /dev/null +++ b/lib/public/files/notfoundexception.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\Files; + +class NotFoundException extends \Exception {} diff --git a/lib/public/files/notpermittedexception.php b/lib/public/files/notpermittedexception.php new file mode 100644 index 0000000000000000000000000000000000000000..0509de7e8291b580d01f948c4253929c8f7f6ae3 --- /dev/null +++ b/lib/public/files/notpermittedexception.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\Files; + +class NotPermittedException extends \Exception {}