| @@ 244-256 (lines=13) @@ | ||
| 241 | /** |
|
| 242 | * {@inheritdoc} |
|
| 243 | */ |
|
| 244 | public function copy($path, $newpath) |
|
| 245 | { |
|
| 246 | $object = $this->applyPathPrefix($path); |
|
| 247 | $newObject = $this->applyPathPrefix($newpath); |
|
| 248 | try { |
|
| 249 | $this->client->copyObject($this->bucket, $object, $this->bucket, $newObject); |
|
| 250 | } catch (OssException $e) { |
|
| 251 | $this->logErr(__FUNCTION__, $e); |
|
| 252 | return false; |
|
| 253 | } |
|
| 254 | ||
| 255 | return true; |
|
| 256 | } |
|
| 257 | ||
| 258 | /** |
|
| 259 | * {@inheritdoc} |
|
| @@ 261-274 (lines=14) @@ | ||
| 258 | /** |
|
| 259 | * {@inheritdoc} |
|
| 260 | */ |
|
| 261 | public function delete($path) |
|
| 262 | { |
|
| 263 | $bucket = $this->bucket; |
|
| 264 | $object = $this->applyPathPrefix($path); |
|
| 265 | ||
| 266 | try { |
|
| 267 | $this->client->deleteObject($bucket, $object); |
|
| 268 | } catch (OssException $e) { |
|
| 269 | $this->logErr(__FUNCTION__, $e); |
|
| 270 | return false; |
|
| 271 | } |
|
| 272 | ||
| 273 | return !$this->has($path); |
|
| 274 | } |
|
| 275 | ||
| 276 | /** |
|
| 277 | * {@inheritdoc} |
|
| @@ 471-483 (lines=13) @@ | ||
| 468 | /** |
|
| 469 | * {@inheritdoc} |
|
| 470 | */ |
|
| 471 | public function getMetadata($path) |
|
| 472 | { |
|
| 473 | $object = $this->applyPathPrefix($path); |
|
| 474 | ||
| 475 | try { |
|
| 476 | $objectMeta = $this->client->getObjectMeta($this->bucket, $object); |
|
| 477 | } catch (OssException $e) { |
|
| 478 | $this->logErr(__FUNCTION__, $e); |
|
| 479 | return false; |
|
| 480 | } |
|
| 481 | ||
| 482 | return $objectMeta; |
|
| 483 | } |
|
| 484 | ||
| 485 | /** |
|
| 486 | * {@inheritdoc} |
|