summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Node/File.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-11-28 20:26:15 +0100
committerGitHub <noreply@github.com>2019-11-28 20:26:15 +0100
commit3cd25846a11f2a201745dcf1704eed7a4e7c168e (patch)
tree1ff8e2ca31fec69184e3c0b7e7ea78110c42948f /lib/private/Files/Node/File.php
parentd37f01a1df0b73efd1cca8126221613265674031 (diff)
parent9eb1554fadf79af54c465f0729ab1de9f24e447d (diff)
downloadnextcloud-server-3cd25846a11f2a201745dcf1704eed7a4e7c168e.tar.gz
nextcloud-server-3cd25846a11f2a201745dcf1704eed7a4e7c168e.zip
Merge pull request #18150 from nextcloud/docs/noid/files-api-exceptions
Properly annotate LockedException in files node api
Diffstat (limited to 'lib/private/Files/Node/File.php')
-rw-r--r--lib/private/Files/Node/File.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/private/Files/Node/File.php b/lib/private/Files/Node/File.php
index b504c7a29da..e4669f70709 100644
--- a/lib/private/Files/Node/File.php
+++ b/lib/private/Files/Node/File.php
@@ -28,6 +28,7 @@ namespace OC\Files\Node;
use OCP\Files\GenericFileException;
use OCP\Files\NotPermittedException;
+use OCP\Lock\LockedException;
class File extends Node implements \OCP\Files\File {
/**
@@ -42,7 +43,8 @@ class File extends Node implements \OCP\Files\File {
/**
* @return string
- * @throws \OCP\Files\NotPermittedException
+ * @throws NotPermittedException
+ * @throws LockedException
*/
public function getContent() {
if ($this->checkPermissions(\OCP\Constants::PERMISSION_READ)) {
@@ -57,8 +59,9 @@ class File extends Node implements \OCP\Files\File {
/**
* @param string|resource $data
- * @throws \OCP\Files\NotPermittedException
+ * @throws NotPermittedException
* @throws \OCP\Files\GenericFileException
+ * @throws LockedException
*/
public function putContent($data) {
if ($this->checkPermissions(\OCP\Constants::PERMISSION_UPDATE)) {
@@ -76,7 +79,8 @@ class File extends Node implements \OCP\Files\File {
/**
* @param string $mode
* @return resource
- * @throws \OCP\Files\NotPermittedException
+ * @throws NotPermittedException
+ * @throws LockedException
*/
public function fopen($mode) {
$preHooks = array();
@@ -113,6 +117,11 @@ class File extends Node implements \OCP\Files\File {
}
}
+ /**
+ * @throws NotPermittedException
+ * @throws \OCP\Files\InvalidPathException
+ * @throws \OCP\Files\NotFoundException
+ */
public function delete() {
if ($this->checkPermissions(\OCP\Constants::PERMISSION_DELETE)) {
$this->sendHooks(array('preDelete'));