diff options
Diffstat (limited to 'lib/private/files/storage/local.php')
-rw-r--r-- | lib/private/files/storage/local.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/private/files/storage/local.php b/lib/private/files/storage/local.php index 0a612ae505b..1c5fafc12fa 100644 --- a/lib/private/files/storage/local.php +++ b/lib/private/files/storage/local.php @@ -90,6 +90,7 @@ if (\OC_Util::runningOnWindows()) { } public function stat($path) { + clearstatcache(); $fullPath = $this->datadir . $path; $statResult = stat($fullPath); if (PHP_INT_SIZE === 4 && !$this->is_dir($path)) { @@ -276,5 +277,25 @@ if (\OC_Util::runningOnWindows()) { public function isLocal() { return true; } + + /** + * get the ETag for a file or folder + * + * @param string $path + * @return string + */ + public function getETag($path) { + if ($this->is_file($path)) { + $stat = $this->stat($path); + return md5( + $stat['mtime'] . + $stat['ino'] . + $stat['dev'] . + $stat['size'] + ); + } else { + return parent::getETag($path); + } + } } } |