Code Duplication    Length = 13-15 lines in 2 locations

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

@@ 549-563 (lines=15) @@
546
		return $this->leave(__FUNCTION__, $result);
547
	}
548
549
	public function isUpdatable($path) {
550
		$this->log('enter: '.__FUNCTION__."($path)");
551
		$result = false;
552
		try {
553
			$info = $this->getFileInfo($path);
554
			// following windows behaviour for read-only folders: they can be written into
555
			// (https://support.microsoft.com/en-us/kb/326549 - "cause" section)
556
			$result = !$info->isHidden() && (!$info->isReadOnly() || $this->is_dir($path));
557
		} catch (NotFoundException $e) {
558
			$this->swallow(__FUNCTION__, $e);
559
		} catch (ForbiddenException $e) {
560
			$this->swallow(__FUNCTION__, $e);
561
		}
562
		return $this->leave(__FUNCTION__, $result);
563
	}
564
565
	public function isDeletable($path) {
566
		$this->log('enter: '.__FUNCTION__."($path)");
@@ 565-577 (lines=13) @@
562
		return $this->leave(__FUNCTION__, $result);
563
	}
564
565
	public function isDeletable($path) {
566
		$this->log('enter: '.__FUNCTION__."($path)");
567
		$result = false;
568
		try {
569
			$info = $this->getFileInfo($path);
570
			$result = !$info->isHidden() && !$info->isReadOnly();
571
		} catch (NotFoundException $e) {
572
			$this->swallow(__FUNCTION__, $e);
573
		} catch (ForbiddenException $e) {
574
			$this->swallow(__FUNCTION__, $e);
575
		}
576
		return $this->leave(__FUNCTION__, $result);
577
	}
578
579
	/**
580
	 * check if smbclient is installed