summaryrefslogtreecommitdiffstats
path: root/lib/private/Files
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2023-01-16 09:43:53 +0100
committerGitHub <noreply@github.com>2023-01-16 09:43:53 +0100
commit5e090d044d3d660316450c3d4d2d7bfc3bde20dd (patch)
tree7d9c504b03440082f680fa0ffae9ea0bec3aacd2 /lib/private/Files
parent269bcdc17ae76b4ec12450396cc2419a76d983d7 (diff)
parent710f3fd4053c233f7a63bb10528ad75e83724e52 (diff)
downloadnextcloud-server-5e090d044d3d660316450c3d4d2d7bfc3bde20dd.tar.gz
nextcloud-server-5e090d044d3d660316450c3d4d2d7bfc3bde20dd.zip
Merge pull request #36075 from fmenabe/s3-storage-class
Add support for s3 storage classes
Diffstat (limited to 'lib/private/Files')
-rw-r--r--lib/private/Files/ObjectStore/S3ConnectionTrait.php4
-rw-r--r--lib/private/Files/ObjectStore/S3ObjectTrait.php4
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
index bdda1f8bee8..09fdffe01bd 100644
--- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php
+++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
@@ -62,6 +62,9 @@ trait S3ConnectionTrait {
/** @var string */
protected $proxy;
+ /** @var string */
+ protected $storageClass;
+
/** @var int */
protected $uploadPartSize;
@@ -81,6 +84,7 @@ trait S3ConnectionTrait {
$this->bucket = $params['bucket'];
$this->proxy = $params['proxy'] ?? false;
$this->timeout = $params['timeout'] ?? 15;
+ $this->storageClass = !empty($params['storageClass']) ? $params['storageClass'] : 'STANDARD';
$this->uploadPartSize = $params['uploadPartSize'] ?? 524288000;
$this->putSizeLimit = $params['putSizeLimit'] ?? 104857600;
$params['region'] = empty($params['region']) ? 'eu-west-1' : $params['region'];
diff --git a/lib/private/Files/ObjectStore/S3ObjectTrait.php b/lib/private/Files/ObjectStore/S3ObjectTrait.php
index e6a2cf21cd0..33b9f6f7fed 100644
--- a/lib/private/Files/ObjectStore/S3ObjectTrait.php
+++ b/lib/private/Files/ObjectStore/S3ObjectTrait.php
@@ -105,6 +105,7 @@ trait S3ObjectTrait {
'Body' => $stream,
'ACL' => 'private',
'ContentType' => $mimetype,
+ 'StorageClass' => $this->storageClass,
]);
}
@@ -123,7 +124,8 @@ trait S3ObjectTrait {
'key' => $urn,
'part_size' => $this->uploadPartSize,
'params' => [
- 'ContentType' => $mimetype
+ 'ContentType' => $mimetype,
+ 'StorageClass' => $this->storageClass,
],
]);