summaryrefslogtreecommitdiffstats
path: root/lib/private/connector/sabre/file.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-12-15 15:20:24 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-12-28 17:17:14 +0100
commit5b00bc1d6e36bb81aee02da612195a048e90a8b4 (patch)
tree8280f2b6c5b8f0f5f2b058886fd1a2db558f159f /lib/private/connector/sabre/file.php
parent9f327457dc74f3e8fc4df17b0d44a99b86c22384 (diff)
downloadnextcloud-server-5b00bc1d6e36bb81aee02da612195a048e90a8b4.tar.gz
nextcloud-server-5b00bc1d6e36bb81aee02da612195a048e90a8b4.zip
Adding basement for the direct download url
Diffstat (limited to 'lib/private/connector/sabre/file.php')
-rw-r--r--lib/private/connector/sabre/file.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php
index 54eea54552f..cb03f30e023 100644
--- a/lib/private/connector/sabre/file.php
+++ b/lib/private/connector/sabre/file.php
@@ -226,6 +226,19 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
return \OC_Helper::getSecureMimeType($mimeType);
}
+ public function getDirectDownload() {
+ if (\OCP\App::isEnabled('encryption')) {
+ return [];
+ }
+ /** @var \OCP\Files\Storage $storage */
+ list($storage, $internalPath) = $this->fileView->resolvePath($this->path);
+ if (is_null($storage)) {
+ return [];
+ }
+
+ return $storage->getDirectDownload($internalPath);
+ }
+
/**
* @param resource $data
* @return null|string