Code Duplication    Length = 17-19 lines in 2 locations

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

@@ 655-673 (lines=19) @@
652
		return $this->leave(__FUNCTION__, $result);
653
	}
654
655
	public function isUpdatable($path) {
656
		$this->log('enter: '.__FUNCTION__."($path)");
657
		$result = false;
658
		try {
659
			$info = $this->getFileInfo($path);
660
			// following windows behaviour for read-only folders: they can be written into
661
			// (https://support.microsoft.com/en-us/kb/326549 - "cause" section)
662
			$result = !$info->isHidden() && (!$info->isReadOnly() || $this->is_dir($path));
663
		} catch (NotFoundException $e) {
664
			$this->swallow(__FUNCTION__, $e);
665
		} catch (ForbiddenException $e) {
666
			$this->swallow(__FUNCTION__, $e);
667
		} catch (Exception $e) {
668
			$ex = new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
669
			$this->leave(__FUNCTION__, $ex);
670
			throw $ex;
671
		}
672
		return $this->leave(__FUNCTION__, $result);
673
	}
674
675
	public function isDeletable($path) {
676
		$this->log('enter: '.__FUNCTION__."($path)");
@@ 675-691 (lines=17) @@
672
		return $this->leave(__FUNCTION__, $result);
673
	}
674
675
	public function isDeletable($path) {
676
		$this->log('enter: '.__FUNCTION__."($path)");
677
		$result = false;
678
		try {
679
			$info = $this->getFileInfo($path);
680
			$result = !$info->isHidden() && !$info->isReadOnly();
681
		} catch (NotFoundException $e) {
682
			$this->swallow(__FUNCTION__, $e);
683
		} catch (ForbiddenException $e) {
684
			$this->swallow(__FUNCTION__, $e);
685
		} catch (Exception $e) {
686
			$ex = new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
687
			$this->leave(__FUNCTION__, $ex);
688
			throw $ex;
689
		}
690
		return $this->leave(__FUNCTION__, $result);
691
	}
692
693
	/**
694
	 * check if smbclient is installed