summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-01-27 00:13:16 +0100
committerRobin Appelman <icewind@owncloud.com>2013-01-27 00:13:50 +0100
commit17bcea15855784f00791ab19984d520a773aa0ca (patch)
tree0d81518e44be5ec63d38a7bb9d7f1b742a8a7370 /lib
parent9e2a066c7bf04dfcc3e2dcc539e1b33053ba70ed (diff)
downloadnextcloud-server-17bcea15855784f00791ab19984d520a773aa0ca.tar.gz
nextcloud-server-17bcea15855784f00791ab19984d520a773aa0ca.zip
Filesystem: add View->getPath to the cache api
Diffstat (limited to 'lib')
-rw-r--r--lib/files/view.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/files/view.php b/lib/files/view.php
index e6b52fb35b6..c2038f222a0 100644
--- a/lib/files/view.php
+++ b/lib/files/view.php
@@ -932,4 +932,19 @@ class View {
return null;
}
}
+
+ /**
+ * Get the path of a file by id, relative to the view
+ *
+ * Note that the resulting path is not guarantied to be unique for the id, multiple paths can point to the same file
+ *
+ * @param int $id
+ * @return string
+ */
+ public function getPath($id) {
+ list($storage, $internalPath) = Cache\Cache::getById($id);
+ $mount = Mount::findById($storage);
+ $fullPath = $mount->getMountPoint() . $internalPath;
+ return $this->getRelativePath($fullPath);
+ }
}