Code Duplication    Length = 16-16 lines in 2 locations

lib/private/Files/View.php 2 locations

@@ 2075-2090 (lines=16) @@
2072
	 *
2073
	 * @return bool False if the path is excluded from locking, true otherwise
2074
	 */
2075
	public function lockFile($path, $type, $lockMountPoint = false) {
2076
		$absolutePath = $this->getAbsolutePath($path);
2077
		$absolutePath = Filesystem::normalizePath($absolutePath);
2078
		if (!$this->shouldLockFile($absolutePath)) {
2079
			return false;
2080
		}
2081
2082
		$this->lockPath($path, $type, $lockMountPoint);
2083
2084
		$parents = $this->getParents($path);
2085
		foreach ($parents as $parent) {
2086
			$this->lockPath($parent, ILockingProvider::LOCK_SHARED);
2087
		}
2088
2089
		return true;
2090
	}
2091
2092
	/**
2093
	 * Unlock a path and all its parents up to the root of the view
@@ 2101-2116 (lines=16) @@
2098
	 *
2099
	 * @return bool False if the path is excluded from locking, true otherwise
2100
	 */
2101
	public function unlockFile($path, $type, $lockMountPoint = false) {
2102
		$absolutePath = $this->getAbsolutePath($path);
2103
		$absolutePath = Filesystem::normalizePath($absolutePath);
2104
		if (!$this->shouldLockFile($absolutePath)) {
2105
			return false;
2106
		}
2107
2108
		$this->unlockPath($path, $type, $lockMountPoint);
2109
2110
		$parents = $this->getParents($path);
2111
		foreach ($parents as $parent) {
2112
			$this->unlockPath($parent, ILockingProvider::LOCK_SHARED);
2113
		}
2114
2115
		return true;
2116
	}
2117
2118
	/**
2119
	 * Only lock files in data/user/files/