Code Duplication    Length = 6-7 lines in 2 locations

lib/private/legacy/util.php 2 locations

@@ 998-1003 (lines=6) @@
995
	public static function checkDataDirectoryValidity($dataDirectory) {
996
		$l = \OC::$server->getL10N('lib');
997
		$errors = [];
998
		if ($dataDirectory[0] !== '/') {
999
			$errors[] = [
1000
				'error' => $l->t('Your Data directory must be an absolute path'),
1001
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
1002
			];
1003
		}
1004
		if (!\file_exists($dataDirectory . '/.ocdata')) {
1005
			$errors[] = [
1006
				'error' => $l->t('Your Data directory  is invalid'),
@@ 1004-1010 (lines=7) @@
1001
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
1002
			];
1003
		}
1004
		if (!\file_exists($dataDirectory . '/.ocdata')) {
1005
			$errors[] = [
1006
				'error' => $l->t('Your Data directory  is invalid'),
1007
				'hint' => $l->t('Please check that the data directory contains a file' .
1008
					' ".ocdata" in its root.')
1009
			];
1010
		}
1011
		return $errors;
1012
	}
1013