@@ 104-119 (lines=16) @@ | ||
101 | /** |
|
102 | * {@inheritdoc} |
|
103 | */ |
|
104 | public function rename($sourceKey, $targetKey) |
|
105 | { |
|
106 | $this->ensureBucketExists(); |
|
107 | $options = $this->getOptions( |
|
108 | $targetKey, |
|
109 | ['CopySource' => $this->bucket . '/' . $this->computePath($sourceKey)] |
|
110 | ); |
|
111 | ||
112 | try { |
|
113 | $this->service->copyObject(array_merge($options, $this->getMetadata($targetKey))); |
|
114 | ||
115 | return $this->delete($sourceKey); |
|
116 | } catch (\Exception $e) { |
|
117 | return false; |
|
118 | } |
|
119 | } |
|
120 | ||
121 | /** |
|
122 | * {@inheritdoc} |
@@ 103-118 (lines=16) @@ | ||
100 | /** |
|
101 | * {@inheritdoc} |
|
102 | */ |
|
103 | public function rename($sourceKey, $targetKey) |
|
104 | { |
|
105 | $this->ensureBucketExists(); |
|
106 | $options = $this->getOptions( |
|
107 | $targetKey, |
|
108 | ['CopySource' => $this->bucket . '/' . $this->computePath($sourceKey)] |
|
109 | ); |
|
110 | ||
111 | try { |
|
112 | $this->service->copyObject(array_merge($options, $this->getMetadata($targetKey))); |
|
113 | ||
114 | return $this->delete($sourceKey); |
|
115 | } catch (\Exception $e) { |
|
116 | return false; |
|
117 | } |
|
118 | } |
|
119 | ||
120 | /** |
|
121 | * {@inheritdoc} |