| @@ 128-140 (lines=13) @@ | ||
| 125 | /** |
|
| 126 | * {@inheritdoc} |
|
| 127 | */ |
|
| 128 | public function copy($path, $newpath) |
|
| 129 | { |
|
| 130 | $object = $this->applyPathPrefix($path); |
|
| 131 | $newObject = $this->applyPathPrefix($newpath); |
|
| 132 | ||
| 133 | try { |
|
| 134 | $this->client->copyObject($this->bucket, $object, $this->bucket, $newObject); |
|
| 135 | } catch (OssException $e) { |
|
| 136 | $this->logErr(__FUNCTION__, $e); |
|
| 137 | return false; |
|
| 138 | } |
|
| 139 | ||
| 140 | return true; |
|
| 141 | } |
|
| 142 | ||
| 143 | /** |
|
| @@ 146-159 (lines=14) @@ | ||
| 143 | /** |
|
| 144 | * {@inheritdoc} |
|
| 145 | */ |
|
| 146 | public function delete($path) |
|
| 147 | { |
|
| 148 | $bucket = $this->bucket; |
|
| 149 | $object = $this->applyPathPrefix($path); |
|
| 150 | ||
| 151 | try { |
|
| 152 | $this->client->deleteObject($bucket, $object); |
|
| 153 | } catch (OssException $e) { |
|
| 154 | $this->logErr(__FUNCTION__, $e); |
|
| 155 | return false; |
|
| 156 | } |
|
| 157 | ||
| 158 | return !$this->has($path); |
|
| 159 | } |
|
| 160 | ||
| 161 | /** |
|
| 162 | * {@inheritdoc} |
|
| @@ 67-79 (lines=13) @@ | ||
| 64 | /** |
|
| 65 | * {@inheritdoc} |
|
| 66 | */ |
|
| 67 | public function getMetadata($path) |
|
| 68 | { |
|
| 69 | $object = $this->applyPathPrefix($path); |
|
| 70 | ||
| 71 | try { |
|
| 72 | $objectMeta = $this->client->getObjectMeta($this->bucket, $object); |
|
| 73 | } catch (OssException $e) { |
|
| 74 | $this->logErr(__FUNCTION__, $e); |
|
| 75 | return false; |
|
| 76 | } |
|
| 77 | ||
| 78 | return $objectMeta; |
|
| 79 | } |
|
| 80 | ||
| 81 | /** |
|
| 82 | * {@inheritdoc} |
|