diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-08-20 16:07:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-20 16:07:59 +0200 |
commit | ac739823958d8cef6fd6e645f8f9f9af89dc7b8f (patch) | |
tree | e9090ffebf0036649c4f23267e1cba85c742222c /apps | |
parent | 03603db486debbb31dfa05486f3b10338a28b50c (diff) | |
parent | 0d6910ac13a52f8bfff51056633ea91848f46752 (diff) | |
download | nextcloud-server-ac739823958d8cef6fd6e645f8f9f9af89dc7b8f.tar.gz nextcloud-server-ac739823958d8cef6fd6e645f8f9f9af89dc7b8f.zip |
Merge pull request #21734 from nextcloud/external-s3-no-touch
disable touch to update mtime for external s3 storage
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/AmazonS3.php | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index 4a49f70dd58..3eedc4719e1 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -550,9 +550,6 @@ class AmazonS3 extends \OC\Files\Storage\Common { } public function touch($path, $mtime = null) { - $path = $this->normalizePath($path); - - $metadata = []; if (is_null($mtime)) { $mtime = time(); } @@ -560,21 +557,8 @@ class AmazonS3 extends \OC\Files\Storage\Common { 'lastmodified' => gmdate(\DateTime::RFC1123, $mtime) ]; - $fileType = $this->filetype($path); try { - if ($fileType !== false) { - if ($fileType === 'dir' && !$this->isRoot($path)) { - $path .= '/'; - } - $this->getConnection()->copyObject([ - 'Bucket' => $this->bucket, - 'Key' => $this->cleanKey($path), - 'Metadata' => $metadata, - 'CopySource' => $this->bucket . '/' . $path, - 'MetadataDirective' => 'REPLACE', - ]); - $this->testTimeout(); - } else { + if (!$this->file_exists($path)) { $mimeType = \OC::$server->getMimeTypeDetector()->detectPath($path); $this->getConnection()->putObject([ 'Bucket' => $this->bucket, |