summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/external/storage.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib/external/storage.php')
-rw-r--r--apps/files_sharing/lib/external/storage.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/external/storage.php b/apps/files_sharing/lib/external/storage.php
index 2771f974614..454196f15ae 100644
--- a/apps/files_sharing/lib/external/storage.php
+++ b/apps/files_sharing/lib/external/storage.php
@@ -33,6 +33,8 @@ class Storage extends DAV implements ISharedStorage {
*/
private $token;
+ private $updateChecked = false;
+
public function __construct($options) {
$this->remote = $options['remote'];
$this->remoteUser = $options['owner'];
@@ -100,4 +102,21 @@ class Storage extends DAV implements ISharedStorage {
}
return $this->scanner;
}
+
+ /**
+ * check if a file or folder has been updated since $time
+ *
+ * @param string $path
+ * @param int $time
+ * @return bool
+ */
+ public function hasUpdated($path, $time) {
+ // since for owncloud webdav servers we can rely on etag propagation we only need to check the root of the storage
+ // because of that we only do one check for the entire storage per request
+ if ($this->updateChecked) {
+ return false;
+ }
+ $this->updateChecked = true;
+ return parent::hasUpdated('', $time);
+ }
}