Code Duplication    Length = 7-11 lines in 2 locations

apps/files_external/lib/storage/streamwrapper.php 1 location

@@ 47-53 (lines=7) @@
44
			if (!is_resource($dh)) {
45
				return false;
46
			}
47
			while (($file = readdir($dh)) !== false) {
48
				if ($this->is_dir($path . '/' . $file)) {
49
					$this->rmdir($path . '/' . $file);
50
				} else {
51
					$this->unlink($path . '/' . $file);
52
				}
53
			}
54
			$url = $this->constructUrl($path);
55
			$success = rmdir($url);
56
			clearstatcache(false, $url);

apps/files_external/lib/storage/swift.php 1 location

@@ 191-201 (lines=11) @@
188
		}
189
190
		$dh = $this->opendir($path);
191
		while ($file = readdir($dh)) {
192
			if (\OC\Files\Filesystem::isIgnoredDir($file)) {
193
				continue;
194
			}
195
196
			if ($this->is_dir($path . '/' . $file)) {
197
				$this->rmdir($path . '/' . $file);
198
			} else {
199
				$this->unlink($path . '/' . $file);
200
			}
201
		}
202
203
		try {
204
			$this->getContainer()->dataObject()->setName($path . '/')->delete();