Code Duplication    Length = 11-12 lines in 2 locations

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

@@ 365-376 (lines=12) @@
362
		}
363
	}
364
365
	public function touch($path, $time = null) {
366
		try {
367
			if (!$this->file_exists($path)) {
368
				$fh = $this->share->write($this->buildPath($path));
369
				fclose($fh);
370
				return true;
371
			}
372
			return false;
373
		} catch (ConnectException $e) {
374
			throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
375
		}
376
	}
377
378
	public function opendir($path) {
379
		try {
@@ 403-413 (lines=11) @@
400
		}
401
	}
402
403
	public function mkdir($path) {
404
		$path = $this->buildPath($path);
405
		try {
406
			$this->share->mkdir($path);
407
			return true;
408
		} catch (ConnectException $e) {
409
			throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
410
		} catch (Exception $e) {
411
			return false;
412
		}
413
	}
414
415
	public function file_exists($path) {
416
		try {