aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Node
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2023-03-14 17:28:22 +0100
committerGitHub <noreply@github.com>2023-03-14 17:28:22 +0100
commit9c3e06c046879857e91d7cf40cf2b9b6842ec0e7 (patch)
tree27be2e6bdf87d2f0fdb195b7bb841b01adf87e6e /lib/private/Files/Node
parent54da84f296579cb09909987bcded0e2a8f92e8cf (diff)
parent4a46c747e9ec5e06b26d4ca4c319fcc40d06d504 (diff)
downloadnextcloud-server-9c3e06c046879857e91d7cf40cf2b9b6842ec0e7.tar.gz
nextcloud-server-9c3e06c046879857e91d7cf40cf2b9b6842ec0e7.zip
Merge pull request #33061 from ibpl/master-IB#1121253
Paths added to messages and message cleanup
Diffstat (limited to 'lib/private/Files/Node')
-rw-r--r--lib/private/Files/Node/Folder.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php
index 90aed642a2d..2c376fe5885 100644
--- a/lib/private/Files/Node/Folder.php
+++ b/lib/private/Files/Node/Folder.php
@@ -1,6 +1,7 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
+ * @copyright Copyright (c) 2022 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/
*
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
@@ -68,7 +69,7 @@ class Folder extends Node implements \OCP\Files\Folder {
public function getFullPath($path) {
$path = $this->normalizePath($path);
if (!$this->isValidPath($path)) {
- throw new NotPermittedException('Invalid path');
+ throw new NotPermittedException('Invalid path "' . $path . '"');
}
return $this->path . $path;
}
@@ -163,14 +164,14 @@ class Folder extends Node implements \OCP\Files\Folder {
$nonExisting = new NonExistingFolder($this->root, $this->view, $fullPath);
$this->sendHooks(['preWrite', 'preCreate'], [$nonExisting]);
if (!$this->view->mkdir($fullPath)) {
- throw new NotPermittedException('Could not create folder');
+ throw new NotPermittedException('Could not create folder "' . $fullPath . '"');
}
$parent = dirname($fullPath) === $this->getPath() ? $this : null;
$node = new Folder($this->root, $this->view, $fullPath, null, $parent);
$this->sendHooks(['postWrite', 'postCreate'], [$node]);
return $node;
} else {
- throw new NotPermittedException('No create permission for folder');
+ throw new NotPermittedException('No create permission for folder "' . $path . '"');
}
}
@@ -194,13 +195,13 @@ class Folder extends Node implements \OCP\Files\Folder {
$result = $this->view->touch($fullPath);
}
if ($result === false) {
- throw new NotPermittedException('Could not create path');
+ throw new NotPermittedException('Could not create path "' . $fullPath . '"');
}
$node = new File($this->root, $this->view, $fullPath, null, $this);
$this->sendHooks(['postWrite', 'postCreate'], [$node]);
return $node;
}
- throw new NotPermittedException('No create permission for path');
+ throw new NotPermittedException('No create permission for path "' . $path . '"');
}
private function queryFromOperator(ISearchOperator $operator, string $uid = null): ISearchQuery {
@@ -230,7 +231,7 @@ class Folder extends Node implements \OCP\Files\Folder {
$limitToHome = $query->limitToHome();
if ($limitToHome && count(explode('/', $this->path)) !== 3) {
- throw new \InvalidArgumentException('searching by owner is only allows on the users home folder');
+ throw new \InvalidArgumentException('searching by owner is only allowed in the users home folder');
}
$rootLength = strlen($this->path);
@@ -392,7 +393,7 @@ class Folder extends Node implements \OCP\Files\Folder {
$nonExisting = new NonExistingFolder($this->root, $this->view, $this->path, $fileInfo);
$this->sendHooks(['postDelete'], [$nonExisting]);
} else {
- throw new NotPermittedException('No delete permission for path');
+ throw new NotPermittedException('No delete permission for path "' . $this->path . '"');
}
}