Code Duplication    Length = 16-16 lines in 2 locations

lib/private/Files/View.php 2 locations

@@ 2004-2019 (lines=16) @@
2001
	 *
2002
	 * @return bool False if the path is excluded from locking, true otherwise
2003
	 */
2004
	public function lockFile($path, $type, $lockMountPoint = false) {
2005
		$absolutePath = $this->getAbsolutePath($path);
2006
		$absolutePath = Filesystem::normalizePath($absolutePath);
2007
		if (!$this->shouldLockFile($absolutePath)) {
2008
			return false;
2009
		}
2010
2011
		$this->lockPath($path, $type, $lockMountPoint);
2012
2013
		$parents = $this->getParents($path);
2014
		foreach ($parents as $parent) {
2015
			$this->lockPath($parent, ILockingProvider::LOCK_SHARED);
2016
		}
2017
2018
		return true;
2019
	}
2020
2021
	/**
2022
	 * Unlock a path and all its parents up to the root of the view
@@ 2030-2045 (lines=16) @@
2027
	 *
2028
	 * @return bool False if the path is excluded from locking, true otherwise
2029
	 */
2030
	public function unlockFile($path, $type, $lockMountPoint = false) {
2031
		$absolutePath = $this->getAbsolutePath($path);
2032
		$absolutePath = Filesystem::normalizePath($absolutePath);
2033
		if (!$this->shouldLockFile($absolutePath)) {
2034
			return false;
2035
		}
2036
2037
		$this->unlockPath($path, $type, $lockMountPoint);
2038
2039
		$parents = $this->getParents($path);
2040
		foreach ($parents as $parent) {
2041
			$this->unlockPath($parent, ILockingProvider::LOCK_SHARED);
2042
		}
2043
2044
		return true;
2045
	}
2046
2047
	/**
2048
	 * Only lock files in data/user/files/