Code Duplication    Length = 11-12 lines in 2 locations

apps/files_external/lib/Lib/Storage/Swift.php 1 location

@@ 86-96 (lines=11) @@
83
	/**
84
	 * @param string $path
85
	 */
86
	private function normalizePath($path) {
87
		$path = \trim($path, '/');
88
89
		if (!$path) {
90
			$path = '.';
91
		}
92
93
		$path = \str_replace('#', '%23', $path);
94
95
		return $path;
96
	}
97
98
	const SUBCONTAINER_FILE = '.subcontainers';
99

lib/private/Files/ObjectStore/ObjectStoreStorage.php 1 location

@@ 547-558 (lines=12) @@
544
	 * @param string $path
545
	 * @return string
546
	 */
547
	private function normalizePath($path) {
548
		$path = \trim($path, '/');
549
		//FIXME why do we sometimes get a path like 'files//username'?
550
		$path = \str_replace('//', '/', $path);
551
552
		// dirname('/folder') returns '.' but internally (in the cache) we store the root as ''
553
		if (!$path || $path === '.') {
554
			$path = '';
555
		}
556
557
		return $path;
558
	}
559
560
	/**
561
	 * Clear all object stat cache entries under this path