diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 621e368f0a3f5..a103e38c2bb99 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -145,6 +145,7 @@ + getPath())]]> @@ -181,6 +182,9 @@ + + getPath())]]> + @@ -636,6 +640,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -667,6 +696,27 @@ + + + + + + + + + + + + + + + + + + + + + node]]> @@ -691,6 +741,21 @@ + + + + + + + + + + + + + + + @@ -700,6 +765,18 @@ info->getId()]]> + + + + + + + + + + + + @@ -729,11 +806,20 @@ + + + + + + + + + @@ -811,6 +897,9 @@ + + + @@ -995,6 +1084,14 @@ + + + + + + + + @@ -1004,6 +1101,14 @@ + + + getPath())]]> + + + getPath())]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1025,10 +1195,30 @@ + + + + + + + + + + + + + + + + + + + + @@ -1039,6 +1229,10 @@ + + + + @@ -1056,11 +1250,23 @@ + + + + + + + + + + + + @@ -1073,6 +1279,10 @@ + + + + @@ -1274,6 +1484,32 @@ getUID())]]> getUID())]]> + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1305,7 +1541,12 @@ + + + + + @@ -1396,6 +1637,15 @@ + + + + + + + + + @@ -1478,6 +1728,22 @@ + + + + + + + + + + + + + + + + @@ -1512,6 +1778,14 @@ + + getShareOwner() . '/files')]]> + getUID() . '/files')]]> + + + getShareOwner() . '/files')]]> + getUID() . '/files')]]> + @@ -1522,6 +1796,15 @@ + + + + + + + + + @@ -1531,6 +1814,12 @@ + + + + + + @@ -1548,6 +1837,10 @@ sourceRootInfo]]> + + + + @@ -1571,6 +1864,15 @@ + + + getUID())]]> + + + + getUID())]]> + + @@ -1599,6 +1901,13 @@ + + + + + + + @@ -1615,6 +1924,18 @@ + + + + + + + + + + + + @@ -1652,12 +1973,20 @@ + + + + + + + + @@ -1674,6 +2003,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1695,6 +2124,13 @@ + + + + + + + @@ -1713,6 +2149,22 @@ + + + + + + + + + + + + + + + + @@ -1742,6 +2194,77 @@ + + + + + + + + + + + + getUID() . '/files')]]> + getUID())]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + getUID() . '/files')]]> + getUID())]]> + + + + + + + + + + + + + getUID())]]> + getUID())]]> + + + + + + + getUID())]]> + getUID())]]> + @@ -3621,7 +4144,6 @@ - @@ -3970,6 +4492,11 @@ + + + + + diff --git a/core/Command/Info/File.php b/core/Command/Info/File.php index 7181f972875ff..952d4bf8e5e0c 100644 --- a/core/Command/Info/File.php +++ b/core/Command/Info/File.php @@ -11,12 +11,12 @@ use OC\Files\ObjectStore\PrimaryObjectStoreConfig; use OC\Files\Storage\Wrapper\Encryption; use OC\Files\Storage\Wrapper\Wrapper; -use OC\Files\View; use OCA\Files_External\Config\ExternalMountPoint; use OCA\GroupFolders\Mount\GroupMountPoint; use OCP\Files\File as OCPFile; use OCP\Files\Folder; use OCP\Files\IHomeStorage; +use OCP\Files\IRootFolder; use OCP\Files\Mount\IMountPoint; use OCP\Files\Node; use OCP\Files\NotFoundException; @@ -31,17 +31,16 @@ class File extends Command { private IL10N $l10n; - private View $rootView; public function __construct( IFactory $l10nFactory, private FileUtils $fileUtils, private \OC\Encryption\Util $encryptionUtil, private PrimaryObjectStoreConfig $objectStoreConfig, + private IRootFolder $rootFolder, ) { $this->l10n = $l10nFactory->get('core'); parent::__construct(); - $this->rootView = new View(); } protected function configure(): void { @@ -70,9 +69,10 @@ public function execute(InputInterface $input, OutputInterface $output): int { if ($node instanceof OCPFile && $node->isEncrypted()) { $output->writeln(' ' . 'server-side encrypted: yes'); $keyPath = $this->encryptionUtil->getFileKeyDir('', $node->getPath()); - if ($this->rootView->file_exists($keyPath)) { + try { + $this->rootFolder->get($keyPath); $output->writeln(' encryption key at: ' . $keyPath); - } else { + } catch (NotFoundException $e) { $output->writeln(' encryption key not found should be located at: ' . $keyPath); } $storage = $node->getStorage(); diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index a852f45396332..ecf2f438edb1f 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -55,6 +55,8 @@ * * Filesystem functions are not called directly; they are passed to the correct * \OC\Files\Storage\Storage object + * + * @internal Since 33.0.0. use IRootFolder and the Folder/File/Node API instead in new code. */ class View { private string $fakeRoot = '';