Code Duplication    Length = 16-16 lines in 2 locations

lib/private/Files/View.php 2 locations

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