@@ 233-245 (lines=13) @@ | ||
230 | /** |
|
231 | * {@inheritdoc} |
|
232 | */ |
|
233 | public function copy($path, $newpath) |
|
234 | { |
|
235 | $object = $this->applyPathPrefix($path); |
|
236 | $newObject = $this->applyPathPrefix($newpath); |
|
237 | ||
238 | try { |
|
239 | $this->client->copyObject($this->bucket, $object, $this->bucket, $newObject); |
|
240 | } catch (OssException $e) { |
|
241 | $this->logErr(__FUNCTION__, $e); |
|
242 | return false; |
|
243 | } |
|
244 | ||
245 | return true; |
|
246 | } |
|
247 | ||
248 | /** |
|
@@ 251-264 (lines=14) @@ | ||
248 | /** |
|
249 | * {@inheritdoc} |
|
250 | */ |
|
251 | public function delete($path) |
|
252 | { |
|
253 | $bucket = $this->bucket; |
|
254 | $object = $this->applyPathPrefix($path); |
|
255 | ||
256 | try { |
|
257 | $this->client->deleteObject($bucket, $object); |
|
258 | } catch (OssException $e) { |
|
259 | $this->logErr(__FUNCTION__, $e); |
|
260 | return false; |
|
261 | } |
|
262 | ||
263 | return !$this->has($path); |
|
264 | } |
|
265 | ||
266 | /** |
|
267 | * {@inheritdoc} |
|
@@ 462-474 (lines=13) @@ | ||
459 | /** |
|
460 | * {@inheritdoc} |
|
461 | */ |
|
462 | public function getMetadata($path) |
|
463 | { |
|
464 | $object = $this->applyPathPrefix($path); |
|
465 | ||
466 | try { |
|
467 | $objectMeta = $this->client->getObjectMeta($this->bucket, $object); |
|
468 | } catch (OssException $e) { |
|
469 | $this->logErr(__FUNCTION__, $e); |
|
470 | return false; |
|
471 | } |
|
472 | ||
473 | return $objectMeta; |
|
474 | } |
|
475 | ||
476 | /** |
|
477 | * {@inheritdoc} |