summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-11-27 12:46:12 +0100
committerVincent Petry <pvince81@owncloud.com>2014-01-23 18:42:56 +0100
commit5ad28f4d1ff952c17f3ca13c8ea7e2e118965846 (patch)
tree8305ccb029a992114ae44f7bd9ffb17530c176a3 /lib
parent5956277ed4db26f46f14eed4a6805038001dde30 (diff)
downloadnextcloud-server-5ad28f4d1ff952c17f3ca13c8ea7e2e118965846.tar.gz
nextcloud-server-5ad28f4d1ff952c17f3ca13c8ea7e2e118965846.zip
Allow getting info or renaming part files through WebDAV
When mounting an ownCloud (backend OC) inside another ownCloud (frontend OC), the frontend OC will use WebDAV to upload file, which will create part files. These part files need to be accessible for the frontend OC to rename them to the actual file name. This fix leaves the file cache untouched but gives direct access to part file info when requested. This means that part file can be accessed only when their path and name are known. These won't appear in file listtings. Fixes #6068
Diffstat (limited to 'lib')
-rw-r--r--lib/private/connector/sabre/objecttree.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/private/connector/sabre/objecttree.php b/lib/private/connector/sabre/objecttree.php
index cd3f081f7cc..d1e179af2ec 100644
--- a/lib/private/connector/sabre/objecttree.php
+++ b/lib/private/connector/sabre/objecttree.php
@@ -38,7 +38,20 @@ class ObjectTree extends \Sabre_DAV_ObjectTree {
return $this->rootNode;
}
- $info = $this->getFileView()->getFileInfo($path);
+ if (pathinfo($path, PATHINFO_EXTENSION) === 'part') {
+ // read from storage
+ $absPath = $this->getFileView()->getAbsolutePath($path);
+ list($storage, $internalPath) = Filesystem::resolvePath('/' . $absPath);
+ if ($storage) {
+ $scanner = $storage->getScanner($internalPath);
+ // get data directly
+ $info = $scanner->getData($internalPath);
+ }
+ }
+ else {
+ // read from cache
+ $info = $this->getFileView()->getFileInfo($path);
+ }
if (!$info) {
throw new \Sabre_DAV_Exception_NotFound('File with name ' . $path . ' could not be located');