summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2021-03-05 08:49:23 +0100
committerGitHub <noreply@github.com>2021-03-05 08:49:23 +0100
commite6ef096e520c512064db3448696c7a3ab8f47147 (patch)
tree6964ffac24587a47e11f5cc7f46759105dcecbda /lib
parent3c9a62721f97fb992a288905f885ac1f23963594 (diff)
parentb8442935361703ce6cd9e17ec50d64584cd35673 (diff)
downloadnextcloud-server-e6ef096e520c512064db3448696c7a3ab8f47147.tar.gz
nextcloud-server-e6ef096e520c512064db3448696c7a3ab8f47147.zip
Merge pull request #25659 from nextcloud/smb-getmetadata-catch
catch notfound and forbidden exception in smb::getmetadata
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/Scanner.php6
-rw-r--r--lib/private/Files/Storage/Storage.php2
-rw-r--r--lib/private/Files/Storage/Wrapper/Encoding.php4
-rw-r--r--lib/private/Files/Storage/Wrapper/Encryption.php4
-rw-r--r--lib/private/Files/Storage/Wrapper/Jail.php4
-rw-r--r--lib/private/Files/Storage/Wrapper/Wrapper.php4
-rw-r--r--lib/public/Files/Cache/IScanner.php4
7 files changed, 6 insertions, 22 deletions
diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php
index 0dbc34fae2f..7bb0341e201 100644
--- a/lib/private/Files/Cache/Scanner.php
+++ b/lib/private/Files/Cache/Scanner.php
@@ -109,7 +109,7 @@ class Scanner extends BasicEmitter implements IScanner {
* *
*
* @param string $path
- * @return array an array of metadata of the file
+ * @return array|null an array of metadata of the file
*/
protected function getData($path) {
$data = $this->storage->getMetaData($path);
@@ -128,7 +128,7 @@ class Scanner extends BasicEmitter implements IScanner {
* @param array|null|false $cacheData existing data in the cache for the file to be scanned
* @param bool $lock set to false to disable getting an additional read lock during scanning
* @param null $data the metadata for the file, as returned by the storage
- * @return array an array of metadata of the scanned file
+ * @return array|null an array of metadata of the scanned file
* @throws \OCP\Lock\LockedException
*/
public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData = null, $lock = true, $data = null) {
@@ -323,7 +323,7 @@ class Scanner extends BasicEmitter implements IScanner {
* @param bool $recursive
* @param int $reuse
* @param bool $lock set to false to disable getting an additional read lock during scanning
- * @return array an array of the meta data of the scanned file or folder
+ * @return array|null an array of the meta data of the scanned file or folder
*/
public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $lock = true) {
if ($reuse === -1) {
diff --git a/lib/private/Files/Storage/Storage.php b/lib/private/Files/Storage/Storage.php
index 56d997ab974..73793aa31fb 100644
--- a/lib/private/Files/Storage/Storage.php
+++ b/lib/private/Files/Storage/Storage.php
@@ -93,7 +93,7 @@ interface Storage extends \OCP\Files\Storage {
/**
* @param string $path
- * @return array
+ * @return array|null
*/
public function getMetaData($path);
diff --git a/lib/private/Files/Storage/Wrapper/Encoding.php b/lib/private/Files/Storage/Wrapper/Encoding.php
index c0587cd0263..e2b486546af 100644
--- a/lib/private/Files/Storage/Wrapper/Encoding.php
+++ b/lib/private/Files/Storage/Wrapper/Encoding.php
@@ -531,10 +531,6 @@ class Encoding extends Wrapper {
return $result;
}
- /**
- * @param string $path
- * @return array
- */
public function getMetaData($path) {
return $this->storage->getMetaData($this->findPathToUse($path));
}
diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php
index ef44be5cefb..a7a915afad9 100644
--- a/lib/private/Files/Storage/Wrapper/Encryption.php
+++ b/lib/private/Files/Storage/Wrapper/Encryption.php
@@ -192,10 +192,6 @@ class Encryption extends Wrapper {
return $data;
}
- /**
- * @param string $path
- * @return array
- */
public function getMetaData($path) {
$data = $this->storage->getMetaData($path);
if (is_null($data)) {
diff --git a/lib/private/Files/Storage/Wrapper/Jail.php b/lib/private/Files/Storage/Wrapper/Jail.php
index dbbe2890df0..b7933708da8 100644
--- a/lib/private/Files/Storage/Wrapper/Jail.php
+++ b/lib/private/Files/Storage/Wrapper/Jail.php
@@ -441,10 +441,6 @@ class Jail extends Wrapper {
return $this->getWrapperStorage()->getETag($this->getUnjailedPath($path));
}
- /**
- * @param string $path
- * @return array
- */
public function getMetaData($path) {
return $this->getWrapperStorage()->getMetaData($this->getUnjailedPath($path));
}
diff --git a/lib/private/Files/Storage/Wrapper/Wrapper.php b/lib/private/Files/Storage/Wrapper/Wrapper.php
index ef8f7293ccb..cffe610c6c2 100644
--- a/lib/private/Files/Storage/Wrapper/Wrapper.php
+++ b/lib/private/Files/Storage/Wrapper/Wrapper.php
@@ -577,10 +577,6 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage, IWriteStrea
return $this->getWrapperStorage()->moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
}
- /**
- * @param string $path
- * @return array
- */
public function getMetaData($path) {
return $this->getWrapperStorage()->getMetaData($path);
}
diff --git a/lib/public/Files/Cache/IScanner.php b/lib/public/Files/Cache/IScanner.php
index 3b00fa2af13..24281e2903d 100644
--- a/lib/public/Files/Cache/IScanner.php
+++ b/lib/public/Files/Cache/IScanner.php
@@ -45,7 +45,7 @@ interface IScanner {
* @param int $parentId
* @param array | null $cacheData existing data in the cache for the file to be scanned
* @param bool $lock set to false to disable getting an additional read lock during scanning
- * @return array an array of metadata of the scanned file
+ * @return array | null an array of metadata of the scanned file
* @throws \OC\ServerNotAvailableException
* @throws \OCP\Lock\LockedException
* @since 9.0.0
@@ -59,7 +59,7 @@ interface IScanner {
* @param bool $recursive
* @param int $reuse
* @param bool $lock set to false to disable getting an additional read lock during scanning
- * @return array an array of the meta data of the scanned file or folder
+ * @return array | null an array of the meta data of the scanned file or folder
* @since 9.0.0
*/
public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $lock = true);