Skip to content

Commit 2b19fe0

Browse files
committed
feature(dav/file): Add readlink method
1 parent f01c600 commit 2b19fe0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,26 @@ public function delete() {
557557
}
558558
}
559559

560+
/**
561+
* Return symlink target of the file
562+
*
563+
* @return string|null
564+
* @throws NotFound
565+
* @throws Forbidden
566+
* @throws FileLocked
567+
*/
568+
public function readlink() {
569+
if (!$this->info->isReadable()) {
570+
throw new NotFound();
571+
}
572+
573+
try {
574+
return $this->fileView->readlink($this->path);
575+
} catch (\Exception $e) {
576+
$this->convertToSabreException($e);
577+
}
578+
}
579+
560580
/**
561581
* Returns the mime-type for a file
562582
*

0 commit comments

Comments
 (0)