diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-11-28 14:17:15 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-11-28 14:17:15 +0100 |
commit | 9eb1554fadf79af54c465f0729ab1de9f24e447d (patch) | |
tree | a8ce16563f64bb62406d9fe97d7c5df81b8a3de5 /lib/public | |
parent | 6b97f6af48ba8dc029e616cf778a1cbcd0fea001 (diff) | |
download | nextcloud-server-9eb1554fadf79af54c465f0729ab1de9f24e447d.tar.gz nextcloud-server-9eb1554fadf79af54c465f0729ab1de9f24e447d.zip |
Properly anotate LockedException in files node api
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/Files/File.php | 13 | ||||
-rw-r--r-- | lib/public/Files/Node.php | 29 |
2 files changed, 29 insertions, 13 deletions
diff --git a/lib/public/Files/File.php b/lib/public/Files/File.php index 1fe01cfb29a..bd3b3da0df2 100644 --- a/lib/public/Files/File.php +++ b/lib/public/Files/File.php @@ -33,6 +33,8 @@ namespace OCP\Files; +use OCP\Lock\LockedException; + /** * Interface File * @@ -44,7 +46,8 @@ interface File extends Node { * Get the content of the file as string * * @return string - * @throws \OCP\Files\NotPermittedException + * @throws NotPermittedException + * @throws LockedException * @since 6.0.0 */ public function getContent(); @@ -53,8 +56,9 @@ interface File extends Node { * Write to the file from string data * * @param string|resource $data - * @throws \OCP\Files\NotPermittedException - * @throws \OCP\Files\GenericFileException + * @throws NotPermittedException + * @throws GenericFileException + * @throws LockedException * @since 6.0.0 */ public function putContent($data); @@ -72,7 +76,8 @@ interface File extends Node { * * @param string $mode * @return resource - * @throws \OCP\Files\NotPermittedException + * @throws NotPermittedException + * @throws LockedException * @since 6.0.0 */ public function fopen($mode); diff --git a/lib/public/Files/Node.php b/lib/public/Files/Node.php index 4468b680014..af7d9454ca6 100644 --- a/lib/public/Files/Node.php +++ b/lib/public/Files/Node.php @@ -34,6 +34,8 @@ namespace OCP\Files; +use OCP\Lock\LockedException; + /** * Interface Node * @@ -45,15 +47,22 @@ interface Node extends FileInfo { * Move the file or folder to a new location * * @param string $targetPath the absolute target path - * @throws \OCP\Files\NotPermittedException - * @return \OCP\Files\Node + * @return Node + * @throws NotFoundException + * @throws NotPermittedException if move not allowed or failed + * @throws LockedException + * @throws InvalidPathException * @since 6.0.0 */ public function move($targetPath); /** * Delete the file or folder + * * @return void + * @throws NotPermittedException + * @throws InvalidPathException + * @throws NotFoundException * @since 6.0.0 */ public function delete(); @@ -62,7 +71,7 @@ interface Node extends FileInfo { * Cope the file or folder to a new location * * @param string $targetPath the absolute target path - * @return \OCP\Files\Node + * @return Node * @since 6.0.0 */ public function copy($targetPath); @@ -72,7 +81,9 @@ interface Node extends FileInfo { * If $mtime is omitted the current time will be used * * @param int $mtime (optional) modified date as unix timestamp - * @throws \OCP\Files\NotPermittedException + * @throws InvalidPathException + * @throws NotFoundException + * @throws NotPermittedException * @return void * @since 6.0.0 */ @@ -81,8 +92,8 @@ interface Node extends FileInfo { /** * Get the storage backend the file or folder is stored on * - * @return \OCP\Files\Storage - * @throws \OCP\Files\NotFoundException + * @return Storage + * @throws NotFoundException * @since 6.0.0 */ public function getStorage(); @@ -247,7 +258,7 @@ interface Node extends FileInfo { * any filesystem operation will automatically acquire the relevant locks for that operation. * * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE - * @throws \OCP\Lock\LockedException + * @throws LockedException * @since 9.1.0 */ public function lock($type); @@ -262,7 +273,7 @@ interface Node extends FileInfo { * Note that this is also the case if no existing lock exists for the file. * * @param int $targetType \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE - * @throws \OCP\Lock\LockedException + * @throws LockedException * @since 9.1.0 */ public function changeLock($targetType); @@ -275,7 +286,7 @@ interface Node extends FileInfo { * Note that this method will not give any sort of error when trying to free a lock that doesn't exist. * * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE - * @throws \OCP\Lock\LockedException + * @throws LockedException * @since 9.1.0 */ public function unlock($type); |