$path = '/user/files/document.txt'; $filesystem = new \OCP\Files\Filesystem(); $absolutePath = $filesystem->resolvePath($path); echo $absolutePath; // output: /var/www/owncloud/data/user/files/document.txt
$path = '/user/files/'; $filesystem = new \OCP\Files\Filesystem(); $absolutePath = $filesystem->resolvePath($path); echo $absolutePath; // output: /var/www/owncloud/data/user/files/In this example, the folder path `/user/files/` is resolved to its absolute path `/var/www/owncloud/data/user/files/`. The `resolvePath` method is part of the ownCloud server PHP library and is included in the `\OCP\Files\Filesystem` class.