| @@ 454-466 (lines=13) @@ | ||
| 451 | } |
|
| 452 | } |
|
| 453 | ||
| 454 | public function touch($path, $time = null) { |
|
| 455 | try { |
|
| 456 | if (!$this->file_exists($path)) { |
|
| 457 | $fh = $this->share->write($this->buildPath($path)); |
|
| 458 | fclose($fh); |
|
| 459 | return true; |
|
| 460 | } |
|
| 461 | return false; |
|
| 462 | } catch (ConnectException $e) { |
|
| 463 | $this->logger->logException($e, ['message' => 'Error while creating file']); |
|
| 464 | throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e); |
|
| 465 | } |
|
| 466 | } |
|
| 467 | ||
| 468 | public function opendir($path) { |
|
| 469 | try { |
|
| @@ 493-504 (lines=12) @@ | ||
| 490 | } |
|
| 491 | } |
|
| 492 | ||
| 493 | public function mkdir($path) { |
|
| 494 | $path = $this->buildPath($path); |
|
| 495 | try { |
|
| 496 | $this->share->mkdir($path); |
|
| 497 | return true; |
|
| 498 | } catch (ConnectException $e) { |
|
| 499 | $this->logger->logException($e, ['message' => 'Error while creating folder']); |
|
| 500 | throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e); |
|
| 501 | } catch (Exception $e) { |
|
| 502 | return false; |
|
| 503 | } |
|
| 504 | } |
|
| 505 | ||
| 506 | public function file_exists($path) { |
|
| 507 | try { |
|