Skip to content

Commit 7ae8463

Browse files
committed
fixup: replace view with node API
Signed-off-by: Salvatore Martire <[email protected]>
1 parent 8a4b78b commit 7ae8463

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

apps/dav/lib/Connector/Sabre/Directory.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -521,19 +521,16 @@ public function getNodeForPath($path): INode {
521521
$destinationDir = dirname($destinationPath);
522522

523523
try {
524-
$this->fileView->verifyPath($destinationDir, $destinationName, true);
525-
$info = $this->fileView->getFileInfo($destinationPath);
524+
/** @var File|Folder $internalNode */
525+
$internalNode = $this->getNode()->get($path);
526+
$info = $internalNode->getFileInfo();
527+
} catch (NotFoundException $e) {
528+
throw new \Sabre\DAV\Exception\NotFound('File with name ' . $destinationPath
529+
. ' could not be located');
526530
} catch (StorageNotAvailableException $e) {
527531
throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage(), 0, $e);
528-
} catch (InvalidPathException $ex) {
532+
} catch (NotPermittedException $ex) {
529533
throw new InvalidPath($ex->getMessage(), false, $ex);
530-
} catch (ForbiddenException $e) {
531-
throw new \Sabre\DAV\Exception\Forbidden($e->getMessage(), $e->getCode(), $e);
532-
}
533-
534-
if (!$info) {
535-
throw new \Sabre\DAV\Exception\NotFound('File with name ' . $destinationPath
536-
. ' could not be located');
537534
}
538535

539536
// if not in a public share with no read permissions, throw Forbidden

0 commit comments

Comments
 (0)