summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinicius Cubas Brand <viniciuscb@gmail.com>2017-02-23 13:32:16 -0300
committerVinicius Cubas Brand <viniciuscb@gmail.com>2017-03-14 10:06:50 -0300
commit13e50cbcd7872bfa40a68622958ec6a4236af9ee (patch)
tree1f3b574f474a9271a6a4461a18129212146c8471
parent8adf61772676bfe71e338fc1c009359135eb381e (diff)
downloadnextcloud-server-13e50cbcd7872bfa40a68622958ec6a4236af9ee.tar.gz
nextcloud-server-13e50cbcd7872bfa40a68622958ec6a4236af9ee.zip
added method needsPartFile() in Storage
Signed-off-by: Vinicius Cubas Brand <viniciuscb@gmail.com>
-rw-r--r--apps/dav/lib/Connector/Sabre/File.php4
-rw-r--r--lib/private/Files/Storage/Common.php7
-rw-r--r--lib/private/Files/Storage/Wrapper/Wrapper.php7
-rw-r--r--lib/public/Files/Storage.php2
4 files changed, 18 insertions, 2 deletions
diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php
index d0826ee5a8c..0e535314c2e 100644
--- a/apps/dav/lib/Connector/Sabre/File.php
+++ b/apps/dav/lib/Connector/Sabre/File.php
@@ -505,9 +505,9 @@ class File extends Node implements IFile {
*/
private function needsPartFile($storage) {
// TODO: in the future use ChunkHandler provided by storage
- // and/or add method on Storage called "needsPartFile()"
return !$storage->instanceOfStorage('OCA\Files_Sharing\External\Storage') &&
- !$storage->instanceOfStorage('OC\Files\Storage\OwnCloud');
+ !$storage->instanceOfStorage('OC\Files\Storage\OwnCloud') &&
+ $storage->needsPartFile();
}
/**
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php
index 5561f6a889b..e3176828364 100644
--- a/lib/private/Files/Storage/Common.php
+++ b/lib/private/Files/Storage/Common.php
@@ -711,4 +711,11 @@ abstract class Common implements Storage, ILockingStorage {
public function setAvailability($isAvailable) {
$this->getStorageCache()->setAvailability($isAvailable);
}
+
+ /**
+ * @return bool
+ */
+ public function needsPartFile() {
+ return true;
+ }
}
diff --git a/lib/private/Files/Storage/Wrapper/Wrapper.php b/lib/private/Files/Storage/Wrapper/Wrapper.php
index 71b64d8c82c..d7cd4b729db 100644
--- a/lib/private/Files/Storage/Wrapper/Wrapper.php
+++ b/lib/private/Files/Storage/Wrapper/Wrapper.php
@@ -610,4 +610,11 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage {
$this->getWrapperStorage()->changeLock($path, $type, $provider);
}
}
+
+ /**
+ * @return bool
+ */
+ public function needsPartFile() {
+ return $this->getWrapperStorage()->needsPartFile();
+ }
}
diff --git a/lib/public/Files/Storage.php b/lib/public/Files/Storage.php
index cf67879908c..ac1872591fa 100644
--- a/lib/public/Files/Storage.php
+++ b/lib/public/Files/Storage.php
@@ -457,4 +457,6 @@ interface Storage extends IStorage {
* @param bool $isAvailable
*/
public function setAvailability($isAvailable);
+
+ public function needsPartFile();
}