summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-12-16 13:15:34 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-12-28 17:17:14 +0100
commit81243b0f5dafb89accaf01a3358226dcec6b2e00 (patch)
treec38e63df3b096b4c52f6eb2266204093e9bfdd0d /lib
parent5b00bc1d6e36bb81aee02da612195a048e90a8b4 (diff)
downloadnextcloud-server-81243b0f5dafb89accaf01a3358226dcec6b2e00.tar.gz
nextcloud-server-81243b0f5dafb89accaf01a3358226dcec6b2e00.zip
adding getDirectDownload() to Wrapper
Diffstat (limited to 'lib')
-rw-r--r--lib/private/connector/sabre/filesplugin.php4
-rw-r--r--lib/private/files/storage/wrapper/wrapper.php12
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/private/connector/sabre/filesplugin.php b/lib/private/connector/sabre/filesplugin.php
index b011a050a5c..ff5a6cc8b4b 100644
--- a/lib/private/connector/sabre/filesplugin.php
+++ b/lib/private/connector/sabre/filesplugin.php
@@ -39,7 +39,7 @@ class OC_Connector_Sabre_FilesPlugin extends \Sabre\DAV\ServerPlugin
$server->protectedProperties[] = '{' . self::NS_OWNCLOUD . '}id';
$server->protectedProperties[] = '{' . self::NS_OWNCLOUD . '}permissions';
$server->protectedProperties[] = '{' . self::NS_OWNCLOUD . '}size';
- $server->protectedProperties[] = '{' . self::NS_OWNCLOUD . '}dDU';
+ $server->protectedProperties[] = '{' . self::NS_OWNCLOUD . '}downloadURL';
$this->server = $server;
$this->server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
@@ -85,7 +85,7 @@ class OC_Connector_Sabre_FilesPlugin extends \Sabre\DAV\ServerPlugin
/** @var $node OC_Connector_Sabre_File */
$directDownloadUrl = $node->getDirectDownload();
if (isset($directDownloadUrl['url'])) {
- $directDownloadUrlPropertyName = '{' . self::NS_OWNCLOUD . '}dDU';
+ $directDownloadUrlPropertyName = '{' . self::NS_OWNCLOUD . '}downloadURL';
$returnedProperties[200][$directDownloadUrlPropertyName] = $directDownloadUrl['url'];
}
}
diff --git a/lib/private/files/storage/wrapper/wrapper.php b/lib/private/files/storage/wrapper/wrapper.php
index d899c88363f..ea9de287361 100644
--- a/lib/private/files/storage/wrapper/wrapper.php
+++ b/lib/private/files/storage/wrapper/wrapper.php
@@ -465,4 +465,16 @@ class Wrapper implements \OC\Files\Storage\Storage {
public function __call($method, $args) {
return call_user_func_array(array($this->storage, $method), $args);
}
+
+ /**
+ * A custom storage implementation can return an url for direct download of a give file.
+ *
+ * For now the returned array can hold the parameter url - in future more attributes might follow.
+ *
+ * @param string $path
+ * @return array
+ */
+ public function getDirectDownload($path) {
+ return $this->storage->getDirectDownload($path);
+ }
}