diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php index 532c50808db23..7a4a4a1194460 100644 --- a/apps/files_external/lib/Lib/Storage/SFTP.php +++ b/apps/files_external/lib/Lib/Storage/SFTP.php @@ -38,6 +38,7 @@ use Icewind\Streams\IteratorDirectory; use Icewind\Streams\RetryWrapper; +use OCP\IRequest; use phpseclib\Net\SFTP\Stream; /** @@ -476,4 +477,16 @@ public function constructUrl($path) { $url = 'sftp://' . urlencode($this->user) . '@' . $this->host . ':' . $this->port . $this->root . $path; return $url; } + + public function hasUpdated($path, $time) { + $storageTime = $this->filemtime($path); + $updated = $storageTime > $time; + if ($updated) { + $req = \OC::$server->get(IRequest::class); + if ($req->getHeader('x-debug-updated')) { + header("x-debug-updated: '$path' updated $storageTime > $time", false); + } + } + return $updated; + } }