Merge pull request #21734 from nextcloud/external-s3-no-touch

disable touch to update mtime for external s3 storage
This commit is contained in:
Morris Jobke 2020-08-20 16:07:59 +02:00 committed by GitHub
commit ac73982395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 17 deletions

View File

@ -550,9 +550,6 @@ class AmazonS3 extends \OC\Files\Storage\Common {
} }
public function touch($path, $mtime = null) { public function touch($path, $mtime = null) {
$path = $this->normalizePath($path);
$metadata = [];
if (is_null($mtime)) { if (is_null($mtime)) {
$mtime = time(); $mtime = time();
} }
@ -560,21 +557,8 @@ class AmazonS3 extends \OC\Files\Storage\Common {
'lastmodified' => gmdate(\DateTime::RFC1123, $mtime) 'lastmodified' => gmdate(\DateTime::RFC1123, $mtime)
]; ];
$fileType = $this->filetype($path);
try { try {
if ($fileType !== false) { if (!$this->file_exists($path)) {
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 {
$mimeType = \OC::$server->getMimeTypeDetector()->detectPath($path); $mimeType = \OC::$server->getMimeTypeDetector()->detectPath($path);
$this->getConnection()->putObject([ $this->getConnection()->putObject([
'Bucket' => $this->bucket, 'Bucket' => $this->bucket,