| @@ 79-91 (lines=13) @@ | ||
| 76 | /** |
|
| 77 | * {@inheritdoc} |
|
| 78 | */ |
|
| 79 | public function copy($path, $newpath) |
|
| 80 | { |
|
| 81 | $path = $this->applyPathPrefix($path); |
|
| 82 | $newpath = $this->applyPathPrefix($newpath); |
|
| 83 | ||
| 84 | try { |
|
| 85 | $this->client->copy($path, $newpath); |
|
| 86 | ||
| 87 | return true; |
|
| 88 | } catch (\Exception $e) { |
|
| 89 | } |
|
| 90 | ||
| 91 | return false; |
|
| 92 | } |
|
| 93 | ||
| 94 | /** |
|
| @@ 122-135 (lines=14) @@ | ||
| 119 | /** |
|
| 120 | * {@inheritdoc} |
|
| 121 | */ |
|
| 122 | public function createDir($dirname, Config $config) |
|
| 123 | { |
|
| 124 | $path = $this->applyPathPrefix($dirname); |
|
| 125 | $response = false; |
|
| 126 | ||
| 127 | try { |
|
| 128 | $object = $this->client->createFolder($path); |
|
| 129 | ||
| 130 | $response = $this->normalizeResponse($object); |
|
| 131 | } catch (\Exception $e) { |
|
| 132 | } |
|
| 133 | ||
| 134 | return $response; |
|
| 135 | } |
|
| 136 | ||
| 137 | /** |
|
| 138 | * {@inheritdoc} |
|
| @@ 206-219 (lines=14) @@ | ||
| 203 | /** |
|
| 204 | * {@inheritdoc} |
|
| 205 | */ |
|
| 206 | public function getMetadata($path) |
|
| 207 | { |
|
| 208 | $path = $this->applyPathPrefix($path); |
|
| 209 | ||
| 210 | try { |
|
| 211 | $object = $this->client->getMetadata($path); |
|
| 212 | ||
| 213 | return $this->normalizeResponse($object); |
|
| 214 | } catch (\Exception $e) { |
|
| 215 | return false; |
|
| 216 | } |
|
| 217 | } |
|
| 218 | ||
| 219 | /** |
|
| 220 | * {@inheritdoc} |
|
| 221 | */ |
|
| 222 | public function getSize($path) |
|
| @@ 286-299 (lines=14) @@ | ||
| 283 | * |
|
| 284 | * @return array|false file metadata |
|
| 285 | */ |
|
| 286 | protected function upload($path, $contents, $mode) |
|
| 287 | { |
|
| 288 | $path = $this->applyPathPrefix($path); |
|
| 289 | ||
| 290 | try { |
|
| 291 | $object = $this->client->upload($path, $contents, $mode); |
|
| 292 | ||
| 293 | return $this->normalizeResponse($object); |
|
| 294 | } catch (\Exception $e) { |
|
| 295 | } |
|
| 296 | ||
| 297 | return false; |
|
| 298 | } |
|
| 299 | } |
|
| 300 | ||