summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/ObjectStore/Swift.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/ObjectStore/Swift.php')
-rw-r--r--lib/private/Files/ObjectStore/Swift.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/Files/ObjectStore/Swift.php b/lib/private/Files/ObjectStore/Swift.php
index 87347c3f71b..ba5eb9e37ff 100644
--- a/lib/private/Files/ObjectStore/Swift.php
+++ b/lib/private/Files/ObjectStore/Swift.php
@@ -86,13 +86,13 @@ class Swift implements IObjectStore {
if (filesize($tmpFile) < SWIFT_SEGMENT_SIZE) {
$this->getContainer()->createObject([
'name' => $urn,
- 'stream' => stream_for($handle)
+ 'stream' => stream_for($handle),
]);
} else {
$this->getContainer()->createLargeObject([
'name' => $urn,
'stream' => stream_for($handle),
- 'segmentSize' => SWIFT_SEGMENT_SIZE
+ 'segmentSize' => SWIFT_SEGMENT_SIZE,
]);
}
}
@@ -113,7 +113,7 @@ class Swift implements IObjectStore {
'stream' => true,
'headers' => [
'X-Auth-Token' => $tokenId,
- 'Cache-Control' => 'no-cache'
+ 'Cache-Control' => 'no-cache',
],
]
);
@@ -148,4 +148,10 @@ class Swift implements IObjectStore {
public function objectExists($urn) {
return $this->getContainer()->objectExists($urn);
}
+
+ public function copyObject($from, $to) {
+ $this->getContainer()->getObject($from)->copy([
+ 'destination' => $this->getContainer()->name . '/' . $to
+ ]);
+ }
}