Code Duplication    Length = 12-13 lines in 2 locations

apps/files_external/lib/Lib/Storage/SMB.php 2 locations

@@ 461-473 (lines=13) @@
458
		}
459
	}
460
461
	public function touch($path, $time = null) {
462
		try {
463
			if (!$this->file_exists($path)) {
464
				$fh = $this->share->write($this->buildPath($path));
465
				fclose($fh);
466
				return true;
467
			}
468
			return false;
469
		} catch (ConnectException $e) {
470
			$this->logger->logException($e, ['message' => 'Error while creating file']);
471
			throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
472
		}
473
	}
474
475
	public function opendir($path) {
476
		try {
@@ 500-511 (lines=12) @@
497
		}
498
	}
499
500
	public function mkdir($path) {
501
		$path = $this->buildPath($path);
502
		try {
503
			$this->share->mkdir($path);
504
			return true;
505
		} catch (ConnectException $e) {
506
			$this->logger->logException($e, ['message' => 'Error while creating folder']);
507
			throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
508
		} catch (Exception $e) {
509
			return false;
510
		}
511
	}
512
513
	public function file_exists($path) {
514
		try {