From 13e50cbcd7872bfa40a68622958ec6a4236af9ee Mon Sep 17 00:00:00 2001 From: Vinicius Cubas Brand Date: Thu, 23 Feb 2017 13:32:16 -0300 Subject: [PATCH] added method needsPartFile() in Storage Signed-off-by: Vinicius Cubas Brand --- apps/dav/lib/Connector/Sabre/File.php | 4 ++-- lib/private/Files/Storage/Common.php | 7 +++++++ lib/private/Files/Storage/Wrapper/Wrapper.php | 7 +++++++ lib/public/Files/Storage.php | 2 ++ 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(); } -- 2.39.5